added code to the mean function