Added documents, and bugfixes