added slider for threshold