PY3 compatibility

change true division to floor division. Ensure that the step argument is > 0.