add comment inside the code

I have added comment insdide the code. Please see the comment start with
"ToDo".