fixed up minheap and main