updated comments and threshold value