added function to find next cell state from 8 neighbors.
Merge branch 'next_state_logic'