Example use of next() and friends