pam algorithm, bugfix, rand index