Why not just have makeGrid return an object with tileHash as the key and state as the value. This is low frequency code so a cleaner interface beats performance.