add some tests and fix a bit