subtotal calculation implemented