It wasn't exactly what I was looking for, but I solved the problem on my own. I convert list2 to an array which is read line by line and removes each number from list3.