refactoring add_cells method in game of life class