insertion sort, helper functions
fix memory leak
merge sort
combined merge sort