Added some code documentation to help with debugging.