use borrowed pointers for match