added function that creates a new set of arrays from the grid