This time, seems working. But logic bugs may also exist.