updated doc and finished issue #567