Calculating average data working