added in grid code, need to intergrate the this