Finished minHeap code