added a new test
fixed the memory issues, started the documentation