added threshold parsing