Since `return range;` is the form of both return statements, this function should probably just have one - the loop using a break statement.