proper range search