Swing all axes and clean up code into for loops