Completed mean function