Refactor transposition logic - NOT COMPLETE