Refactored avgByFifteen into avg method

Added avgVal variable to keep track of number of values to average