Added methods for serializing inventory