example of an anonymous function being used as a callback