Implement def total()