add return type for total()