finish implementation of prim's mst using the heap