Implemented insertion sort.