Implement insertion sort