Insertion sort implementation in c++