Update SearchEngine.java

Removed unused code and duplicate code in compare functions. Also removed some other unnecessary comments and white space.