added more tests, simplified existing tests, added more docs.