updated distance cache