Commit 10: Cleaned up the code.  Added a few more comments for better understanding.