New version of game of life in javascript