Ad insertion sort