Here are the MATLAB and R implementations of the MERGE algorithm (Academic Use Only):