PEP8 formatting, got rid of '.has_key()' deprecated over 'key in dict'