Add the locate algorithm