Possibly correct realisation of the Iterator class.