update to "getMean" method to include iterators