cleanup and some debug info