complete generation function, program now capable of simulating generations of game of life