simplified calculations of row counts