added comment and better variable names