Adding debugMode functionality. Related to 15