Bug fixing : Incorrect step counting