removed debug prints
moved spanning tree formation to log - creating the spanning tree first