Added new debug function