change generator to range.