getting grid code