this is the logic for Game of Life
cleaned up the cell checking code significantly