Mean calculation corrected