improved doc, tests