add experimental auto-threshold feature