Implement insertInOrder