the product.write() method that calculates wether a product can be sold is now more efficient