calculate first rows; calculate pcs