Update Functions for Backtrack and didtance naive approach