Added a threshold funtion