added comments in the code