max is optional, but min is not. If min is not specified then doIds would start at 0. Maybe it should be renamed from min to start, and from max to end.