Prims Algorithm implementation in c++. (fixes)