Copied inventory code for storage