Added comments, refined variable names