prims algorithm added and commented