added counts for rows and cols