Manual insertion sort implemented