complete rewrite of jackknife.py.