Added iterators to a couple of functions, defined a “print” function.