some cosmetic changes to variable names and function names