My game of life javascript solution