Changed x,y movement to globals