update for better threshold