added support for functions with arguments