Added function

Added function earnAverage