working getAllEdges but failing minimumSpanningTree method