Added function to find average of sample -NH