adds subtotal functionality