needed to move x0,y0 definitions in init