adding variance and mean functions