result path calculation