switched some functions from x,y to position