Cosmetic changes.  Each function should get a docstring.  Standalone comments should be complete sentences while inline comments can just be a few words.  Always space around equality operators, i.e., x = 3 not x=3, with the exception of keyword arguments to functions. Always space between function arguments.