Simplified the createGrid function a bit in the tree test.