add debugging
add tests