Implement better comparator. Fix #8