cleanup a bit, add some debug output