modified copying of distance_sensor library