replaced odd sort code with a manual comparison of the ident property