add tests and docs(master)