Tile flipping works up to a point. Needs debugging