Pulling the $step number out of the scope of the if statement.