Added a return and setting up function for an anonymous function