* added tests
* fixed minor bugs