This was an experemental code. The real working solution is:
```
if step <=  scaled_raw_step:
```