better output and some more tests (looks like it's working)