Added a python version of the merge algorithm for reference