Comment removal, some renaming of variables for clarity