Grid struct and init function changed