Added reduce subtotal function, but still need to solve a bug in it