not finished implementation of detecting ranges with average distance