added calcavg and changed main. Broken