first implementation of distance_scanner