Update cells array based on cell state