grid generation code proof started