Short circuit for speed in MST.py