Implement inRange method