Refactored swapped_letters method