Need guidance on small code

Changing the position of { didn't change anything

Of course not. But it DID make it easier to see the problem.

Post your modified code, and I'll point out the problem.