Removed deepcopy in MST calculation