docstrings
added connection tests
some bug fixes