added write functionality and validation before placing in the container.