recalculate distance and plan