Added one function to Prim's algortihm. (prim)