Add a test
Use callbacks and recursion instead of iterators
More logging and a TODO