Using raw string literals instead.
Fixed naming.
Fixed formatting and revised comments.
Style and logging tweaks.