mapping ordered pairs function