Removed unneccessary final edge distance check
Removed unnecessary dependencies