calculation moved to avg method