added mean pairwise similarity metric