Adding terminal input for threshold