Compute the rmsd better