fixed insertion sort and added test