One way to implement map-invert