Made comparison algorithm slightly more intelligent and slightly more efficient.