Added a debug function