Better comparison algorithm and spec