added a few more tests and fixed documentation
fixed couple memory leaks