Dynamic Dissimilarity Function

Main refined, all the class have to be updated.