added minimum spanning tree algorithm
Fixed small errors which were causing uninitialised variables to propogate