updated inventory management to handle combining.