sort out debug output