reworked debug logging, added some loading code