EHN: improving code

add set_result and comment