Minor refactor, add coords_average function
Fix rotation direction after flipping