fixing some of the comparison functions (they are too type-restrictive to the point of being useless)