Fixed a bug in similarity detection function. Same node was being compared and was returned as result. Fixed it