Replaced sort algorithm with insertion sort