some debug code, reformatting