set function env items based on 'result' variable, if used