implemented iterators and operator[]