Why does the LED turn on after the while loop becomes false?

the ";" at the end of the line is the while loop body which will be executed while the pin is LOW.

i don't think you need the while loop