partial work on similarity detection