Clean up generateGrid