- added correct evaluation of functions