cell logic