replace exist() with the ranged version