add some doc and comments