fixed the switch(move) placement and fixed ij -> xy