Implement prototype of simliarity measure.