delete debugging code
add testcases
bugfix