add some comments and check mode impl