cell automata implementation