updated doc and comments