believe to have handled the case where two ports have equal hop distances (but should test it...)