getting grid bounds