pairwise functions for operating on lists