swapPatterns() implemented and identical