fixed very stupid bug in the tests.
added lots of comments.