fixed some bugs in the python threshold stuff, but it's pretty slow