anonymous function to defined function