Minor changes: renamed some variables.