Added code for classes and custom iterators