Cleaned up comparison functions