Coded an insertion sort in C++