Improve output, add simple test.