improved doc
added unittests