added comments with brief explanations