corrected mean calculation