sequencing analogRead

I think you are missing some "{" and "}"

after these statements :

if (ledPin, HIGH)

in each of the 3 main blocks