Clean up code: remove some trailing whitespace, change variable names to python convention.