Finish direct distance and path distance