Updated to use word debug instead of test, added some docs to existing
code