Added more debugging code, fixed some inaccurate comments.