Looking at it now, it seems more logical to put the average methods in the Node class rather than the Grid class but then I don't know how to pass those methods to Grid.traverse(). Any ideas? Other comments on how this code could be better?