modified functions: find_nearest