Updating step detector lgorithm