Added a transposition function.