added simple comparator code for checking similarity