add distance and path