updated documentation; added some more tests and fixed some smaller bugs