Renamed compareObjects function