makes minHeap and parses input