adapted the iterator so it can work with multiple stepsizes