update JS

was missing function for merge sort