Adds MinHeap and fixes maxheap