updated doc, fixed unit tests