Dictionary key initializations

Switching variables

Use truth value testing

Test for main to avoid unexpected code execution