Merge sorted lists implementation