added a reduce_quantity function