Inventory dynamics and the bullwhip effect