Move extra logging to be toggled by debug_logging variable. Migrate doc string to comment
PEP8'd code. Addressed formatting issues minus some long lines