Updated variable names and added line-by-line comments.