adding functions mean and var