This is basically insertion sort!