re-implementation of the merger script. it is much more powerful than
the previous version.