Updated grid to encode entityID differently