Modified comparator engine for efficiency. Also edited the ruleset.
Logic coding complete.