Copied writeConfig Method to WriteConfig class.