Debugged. Accepts YAML too..