debug formatting code