trying out my own (non-idiomatic) iterator class