why is this in the while loop?