added similarity calculation