shell sort function