fixed bug, related to the optional "step" argument