move reusable stuff to utils
merge sort too