calculate cells values (step 1)