Revert "remove debug because it is neither needed nor working"

I will try again

This reverts commit bc0072fce91328aff6607ad83061fa8a49ba672a.
now the debug switch works