added config and pybuilder stuff, fixed handling of tresholds