more work on python debug, needs tests