The current code is incorrect due to weak preorder