pairwise methods less hacky (thanks Bernd Gruber)