need cross version compatible implementation of iterator 'next'