solution with comments

added commetns