Uh, note that y = 0 assigns 0 to y. You probably want to compare instead, with y == 0.