add some comments which explains some code snippets.