locate function