added locate function

not tested.