Changed quantitiy related code