Update distance