update total_ordering function