implemented mean and test_mean functions