put the mergeJoin function into its own class