rewrote much of the compare logic (still wip though)