Add a function, mean(), to mm.c to calculate the mean

Add a function, mean(), to mm.c to calculate the mean