add documentation
add tests for Document