added support for function calls as terms