Fleshing out the debug functions