Added debug USE flag and functionality