Implementations for PAIR, FIRST and SECOND