Added all of the debug functionality