Implements iteration