some minor changes in formatting and variable names