handling functions with functions