Change while into for in detector.py
Add small example for smoothing data in detector.py