added comments

more detailed description and clearer comments