Added the code to addMetadata and toString