fix comments
add helper tests
add swap and isSorted