Updated source code with comments.