Finished implementation of recursive grid traversal