First implementation of iterator pattern