move grid data into struct