fixed bug with infinite loop y-- then y++