I have no idea how the merge() and split() work, but your thought process seems sound. They might have a error in them...

You also need to keep the 'tail' pointer up to date.