I suppose a null continuation could have been used to signal 'done' to simplify, without yet looking at the code that uses it.