Added retrun to mean function