added comments in code