add tests, fix syntax errors