Reworked in/out of stock function.