get rid of if statement for swapAxes