changed threshold to maximum