added swapFirstWithLast()