Fixing Step Detector Algorithm