All done cleaning up the code and adding header file comments.