Simplified intsort function.