removed dependency on iterators