Changed sum and mean functions

Changed sum to read an expression and calculate sum.
Changed mean to read an expression and calculate mean.
Improved mean to return floating point.