updated grid generator