Implement average calculator