Implemented an iterator and iterable