Added functionality to clear the old grid and generate a new one