added rangefinder code