add some comment and delete some useless code