change x,y to i,j