simplified and commented merge.py algorithm a bit

Hi, I tried to make the algorithm in merge.py a little easier to understand.