revision to the structure of life.js. made anonymous function