FIxed bug in similarity