computed pairwise avg and diff