fixed a memory leak among other things
added the tester