I tried to place the 2nd if statement inside the loop statement and in the first if statement, and it keeps on saying "exists" cannot be a resolved to a variable.