Added comments for findThreshold()