Implemented the insertion sort sorting algorithm