templates and iterators