Added calculation of mean