updated variable names and commented code