Calculated mean

Added function to calculate mean