game of life implementation sorted