randomly selecting two entries to do range search