handling for ranges and their limits improved