Add locate function