replace for comprehension to range