created a method to simplify code to generate heaps for profiling the union of sets. TODO: Finish documnetation and test the new implementatino.