updated to read and write the Person objects into the YAML file