added code to insert to min max heaps