week3: added some more comments and explanations