updated pollutantmean function