reworked debug.py