updated doc and small correction in code