read entire grid first