Reformatting style and adding comments

No functional changes