Add server-side code for insertion sort.