Added basic folding for Python