added suggested docstrings and comments
added more robust content testing for metadata file generation