Added CMD debug option; removed 2 unused functions