Added a debug mode