added debug mode operation to engine