added external merge sort code