Rename some variables, add some comments