add python-yaml and fix algo