stepdetector V3 (works pretty well)

only based on MAX-MIN instead of MIN MAX MIN