Implemented Prims in pseudocode