some more tests, code redesigned