Finished Prim's Algorithm