updated doc with code sample