Added threshold and scalar settings