fixed the loop termination conditional as the algorithm typically result in a spanning forest instead of a tree
fixed MV update criteria (closes #4)