seems like the body of this function could be made a utility in `loc_util` (especially since it's reproduced in `psi_prototype`)