fixing bugs in getAverage