Used rows and grid length to determine grid size