add code, examples and write doc