added function definitions and evaluation
fixed imported names