Make all coordinates y x instead of x y. One bug remains