reverted compare funcs and return values, should be int anyway