My impl of game of life