Added similarity functionality.