if(foundIt = false){
The = operator is for assignment, Use the == operator for comparison.

It is better to code if(!foundIt)
then to try to compare its value with an == operator