Added extra debugging functionality