use anonymous function to initialize things