Added support for functions and return values