updating code with inline comments