added locate function