tested and debugged const_iterator