Updated for better threshold