off by 1 error fixed when reading grid files