DOC: add docstrings
TEST: test with files too