add debug mode (closes #15)