Added anonymous function around all the code.