add tests, fix nl