Does almost everything we need, just have to wrap up some loose ends regarding ties during path calculation