Improved RunningAverage algorithm