huge performance improvement on building gridStates (10x faster) and gridObjects (4x faster)