add tests
add debugging output