rewrote permuteLeft to actually not be terrible