My JS solution for conway's game of life