Modified StoDetector.py; specified the threshld using chi-squared estimate.