flake8 make pretty

Revise source looking at flake8 output. 
Try to make variable names more helpful, and code more idiomatic.
Make indentation consistent.