add distance measured function