Loop certain number of times then do action

I see the problem:
Your number of steps exceeds the size of an int.
Make numberOfSteps a const unsigned int.