some comments added

to make the code more comprehensive