slightly changed how for ranges work