Changed insertion sort to selection sort