replaced .at() with [] and optimized trimIntegerMean