updated distance test