Added some code commentaries.