added configurable iteration length