Implemented the step counter.