modified formatting and changed variable names