added debug mode to the model