Messing up with Prim's Algo