added similarity code