Index: sasmodels/py2c.py
===================================================================
--- sasmodels/py2c.py	(revision fb5c8c783c58cc480305945669966aa3dc6d2467)
+++ sasmodels/py2c.py	(revision fa74acf62581ad72b63eeede5edd1bb6b2d28e59)
@@ -12,20 +12,23 @@
     Variables definition in C
     -------------------------
-    Defining variables within the Translate function is a bit of a guess work, using following rules.
+    Defining variables within the Translate function is a bit of a guess work,
+    using following rules.
     *   By default, a variable is a 'double'.
     *   Variable in a for loop is an int.
-    *   Variable that is references with brackets is an array of doubles. The variable within the brackets
-        is integer. For example, in the reference 'var1[var2]', var1 is a double array, and var2 is an integer.
-    *   Assignment to an argument makes that argument an array, and the index in that assignment is 0.
+    *   Variable that is references with brackets is an array of doubles. The
+        variable within the brackets is integer. For example, in the
+        reference 'var1[var2]', var1 is a double array, and var2 is an integer.
+    *   Assignment to an argument makes that argument an array, and the index in
+        that assignment is 0.
         For example, the following python code
-            def func (arg1, arg2):
+            def func(arg1, arg2):
                 arg2 = 17.
         is translated to the following C code
-            double func (double arg1)
+            double func(double arg1)
             {
                 arg2[0] = 17.0;
             }
         For example, the following python code is translated to the following C code
-            def func (arg1, arg2):          double func (double arg1) {
+            def func(arg1, arg2):          double func(double arg1) {
                 arg2 = 17.                      arg2[0] = 17.0;
                                             }
@@ -35,17 +38,23 @@
 Update Notes
 ============
-11/22 14:15, O.E.   Each 'visit_*' method is to build a C statement string. It shold insert 4 blanks per indentation level.
-                    The 'body' method will combine all the strings, by adding the 'current_statement' to the c_proc string list
+11/22 14:15, O.E.   Each 'visit_*' method is to build a C statement string. It
+                    shold insert 4 blanks per indentation level.
+                    The 'body' method will combine all the strings, by adding
+                    the 'current_statement' to the c_proc string list
    11/2017, OE: variables, argument definition implemented.
-   Note: An argument is considered an array if it is the target of an assignment. In that case it is translated to <var>[0]
+   Note: An argument is considered an array if it is the target of an
+        assignment. In that case it is translated to <var>[0]
 11/27/2017, OE: 'pow' basicly working
   /12/2017, OE: Multiple assignment: a1,a2,...,an=b1,b2,...bn implemented
-  /12/2017, OE: Power function, including special cases of square(x) (pow(x,2)) and cube(x) (pow(x,3)), implemented in translate_power,
-                called from visit_BinOp
-12/07/2017, OE: Translation of integer division, '\\' in python, implemented in translate_integer_divide, called from visit_BinOp
+  /12/2017, OE: Power function, including special cases of
+                square(x)(pow(x,2)) and cube(x)(pow(x,3)), implemented in
+                translate_power, called from visit_BinOp
+12/07/2017, OE: Translation of integer division, '\\' in python, implemented
+                in translate_integer_divide, called from visit_BinOp
 12/07/2017, OE: C variable definition handled in 'define_C_Vars'
-              : Python integer division, '//', translated to C in 'translate_integer_divide'
-12/15/2017, OE: Precedence maintained by writing opening and closing parenthesesm '(',')',
-                in procedure 'visit_BinOp'.
+              : Python integer division, '//', translated to C in
+                'translate_integer_divide'
+12/15/2017, OE: Precedence maintained by writing opening and closing
+                parenthesesm '(',')', in procedure 'visit_BinOp'.
 """
 import ast
@@ -72,5 +81,5 @@
 
 CMPOP_SYMBOLS = {}
-CMPOP_SYMBOLS[ast.Eq] = '=='
+CMPOP_SYMBOLS[ast.Eq]    = '=='
 CMPOP_SYMBOLS[ast.NotEq] = '!='
 CMPOP_SYMBOLS[ast.Lt] = '<'
@@ -122,5 +131,5 @@
     except:
         return False
-    
+
 class SourceGenerator(NodeVisitor):
     """This visitor is able to transform a well formed syntax tree into python
@@ -168,30 +177,30 @@
     def write_c(self, x):
         self.current_statement += x
-        
+
     def add_c_line(self, x):
         string = ''
-        for i in range (self.indentation):
+        for i in range(self.indentation):
             string += ("    ")
         string += str(x)
-        self.c_proc.append (str(string + "\n"))
+        self.c_proc.append(str(string + "\n"))
         x = ''
 
-    def add_current_line (self):
-        if (len(self.current_statement) > 0):
-            self.add_c_line (self.current_statement)
+    def add_current_line(self):
+        if(len(self.current_statement) > 0):
+            self.add_c_line(self.current_statement)
             self.current_statement = ''
 
-    def AddUniqueVar (self, new_var):
-        if ((new_var not in self.C_Vars)):
-            self.C_Vars.append (str (new_var))
-
-    def WriteSincos (self, node):
+    def AddUniqueVar(self, new_var):
+        if((new_var not in self.C_Vars)):
+            self.C_Vars.append(str(new_var))
+
+    def WriteSincos(self, node):
         angle = str(node.args[0].id)
-        self.write_c (node.args[1].id + " = sin (" + angle + ");")
+        self.write_c(node.args[1].id + " = sin(" + angle + ");")
         self.add_current_line()
-        self.write_c (node.args[2].id + " = cos (" + angle + ");")
+        self.write_c(node.args[2].id + " = cos(" + angle + ");")
         self.add_current_line()
         for arg in node.args:
-            self.AddUniqueVar (arg.id)
+            self.AddUniqueVar(arg.id)
 
     def newline(self, node=None, extra=0):
@@ -200,20 +209,20 @@
             self.write_c('# line: %s' % node.lineno)
             self.new_lines = 1
-        if (len(self.current_statement)):
-            self.Statements.append (self.current_statement)
+        if(len(self.current_statement)):
+            self.Statements.append(self.current_statement)
             self.current_statement = ''
 
     def body(self, statements):
-        if (len(self.current_statement)):
-            self.add_current_line ()
+        if(len(self.current_statement)):
+            self.add_current_line()
         self.new_line = True
         self.indentation += 1
         for stmt in statements:
             target_name = ''
-            if (hasattr (stmt, 'targets')):
-                if (hasattr(stmt.targets[0],'id')):
+            if(hasattr(stmt, 'targets')):
+                if(hasattr(stmt.targets[0], 'id')):
                     target_name = stmt.targets[0].id # target name needed for debug only
             self.visit(stmt)
-        self.add_current_line () # just for breaking point. to be deleted. 
+        self.add_current_line() # just for breaking point. to be deleted.
         self.indentation -= 1
 
@@ -234,12 +243,13 @@
 # for C
         for arg in node.args:
-            self.arguments.append (arg.arg)
-
-        padding = [None] * (len(node.args) - len(node.defaults))
+            self.arguments.append(arg.arg)
+
+        padding = [None] *(len(node.args) - len(node.defaults))
         for arg, default in zip(node.args, padding + node.defaults):
             if default is not None:
-                self.warnings.append ("Default Parameter unknown to C")
-                w_str = "Default Parameters are unknown to C: '" + arg.arg + " = " + str(default.n) + "'"
-                self.warnings.append (w_str)
+                self.warnings.append("Default Parameter unknown to C")
+                w_str = "Default Parameters are unknown to C: '" + arg.arg + \
+                        " = " + str(default.n) + "'"
+                self.warnings.append(w_str)
 #                self.write_python('=')
 #                self.visit(default)
@@ -258,40 +268,40 @@
         self.visit(node.test)
         if node.msg is not None:
-           self.write_python(', ')
-           self.visit(node.msg)
-
-    def define_C_Vars (self, target):
-        if (hasattr (target, 'id')):
+            self.write_python(', ')
+            self.visit(node.msg)
+
+    def define_C_Vars(self, target):
+        if(hasattr(target, 'id')):
 # a variable is considered an array if it apears in the agrument list
 # and being assigned to. For example, the variable p in the following
 # sniplet is a pointer, while q is not
-# def somefunc (p, q):
+# def somefunc(p, q):
 #  p = q + 1
 #  return
 #
-            if (target.id not in self.C_Vars):
-                if (target.id in self.arguments):
-                    idx = self.arguments.index (target.id)
+            if(target.id not in self.C_Vars):
+                if(target.id in self.arguments):
+                    idx = self.arguments.index(target.id)
                     new_target = self.arguments[idx] + "[0]"
-                    if (new_target not in self.C_Pointers):
+                    if(new_target not in self.C_Pointers):
                         target.id = new_target
-                        self.C_Pointers.append (self.arguments[idx])
+                        self.C_Pointers.append(self.arguments[idx])
                 else:
-                    self.C_Vars.append (target.id)
-
-    def add_semi_colon (self):
+                    self.C_Vars.append(target.id)
+
+    def add_semi_colon(self):
         semi_pos = self.current_statement.find(';')
-        if (semi_pos < 0):
+        if(semi_pos < 0):
             self.write_c(';')
 
     def visit_Assign(self, node):
-        self.add_current_line ()
+        self.add_current_line()
         for idx, target in enumerate(node.targets): # multi assign, as in 'a = b = c = 7'
             if idx:
                 self.write_c(' = ')
-            self.define_C_Vars (target)
+            self.define_C_Vars(target)
             self.visit(target)
-        if (len(self.Tuples) > 0):
-            tplTargets = list (self.Tuples)
+        if(len(self.Tuples) > 0):
+            tplTargets = list(self.Tuples)
             self.Tuples.clear()
         self.write_c(' = ')
@@ -299,37 +309,37 @@
         self.visited_args = False
         self.visit(node.value)
-        self.add_semi_colon ()
+        self.add_semi_colon()
 #        self.write_c(';')
-        self.add_current_line ()
-        for n,item in enumerate (self.Tuples):
+        self.add_current_line()
+        for n, item in enumerate(self.Tuples):
             self.visit(tplTargets[n])
             self.write_c(' = ')
             self.visit(item)
-            self.add_semi_colon ()
-            self.add_current_line ()
-        if ((self.is_sequence) and (not self.visited_args)):
+            self.add_semi_colon()
+            self.add_current_line()
+        if((self.is_sequence) and (not self.visited_args)):
             for target in node.targets:
-                if (hasattr (target, 'id')):
-                    if ((target.id in self.C_Vars) and (target.id not in self.C_DclPointers)):
-                        if (target.id not in self.C_DclPointers):
-                            self.C_DclPointers.append (target.id)
-                            if (target.id in self.C_Vars):
+                if(hasattr(target, 'id')):
+                    if((target.id in self.C_Vars) and(target.id not in self.C_DclPointers)):
+                        if(target.id not in self.C_DclPointers):
+                            self.C_DclPointers.append(target.id)
+                            if(target.id in self.C_Vars):
                                 self.C_Vars.remove(target.id)
         self.current_statement = ''
 
     def visit_AugAssign(self, node):
-        if (node.target.id not in self.C_Vars):
-            if (node.target.id not in self.arguments):
-                self.C_Vars.append (node.target.id)
+        if(node.target.id not in self.C_Vars):
+            if(node.target.id not in self.arguments):
+                self.C_Vars.append(node.target.id)
         self.visit(node.target)
         self.write_c(' ' + BINOP_SYMBOLS[type(node.op)] + '= ')
         self.visit(node.value)
-        self.add_semi_colon ()
+        self.add_semi_colon()
 #        self.write_c(';')
-        self.add_current_line ()
+        self.add_current_line()
 
     def visit_ImportFrom(self, node):
         self.newline(node)
-        self.write_python('from %s%s import ' % ('.' * node.level, node.module))
+        self.write_python('from %s%s import ' %('.' * node.level, node.module))
         for idx, item in enumerate(node.names):
             if idx:
@@ -349,53 +359,53 @@
     def listToDeclare(self, Vars):
         s = ''
-        if (len(Vars) > 0):
-            s = ",".join (Vars)
-        return (s)
-
-    def write_C_Pointers (self, start_var):
-        if (len (self.C_DclPointers) > 0):
+        if(len(Vars) > 0):
+            s = ",".join(Vars)
+        return(s)
+
+    def write_C_Pointers(self, start_var):
+        if(len(self.C_DclPointers) > 0):
             vars = ""
             for c_ptr in self.C_DclPointers:
-                if (len(vars) > 0):
+                if(len(vars) > 0):
                     vars += ", "
-                if (c_ptr not in self.arguments):
+                if(c_ptr not in self.arguments):
                     vars += "*" + c_ptr
-                if (c_ptr in self.C_Vars):
-                    if (c_ptr in self.C_Vars):
-                        self.C_Vars.remove (c_ptr)
-            if (len(vars) > 0):
+                if(c_ptr in self.C_Vars):
+                    if(c_ptr in self.C_Vars):
+                        self.C_Vars.remove(c_ptr)
+            if(len(vars) > 0):
                 c_dcl = "    double " + vars + ";"
-                self.c_proc.insert (start_var, c_dcl + "\n")
+                self.c_proc.insert(start_var, c_dcl + "\n")
                 start_var += 1
         return start_var
 
-    def insert_C_Vars (self, start_var):
+    def insert_C_Vars(self, start_var):
         fLine = False
-        start_var = self.write_C_Pointers (start_var)
-        if (len(self.C_IntVars) > 0):
+        start_var = self.write_C_Pointers(start_var)
+        if(len(self.C_IntVars) > 0):
             for var in self.C_IntVars:
-                if (var in self.C_Vars):
+                if(var in self.C_Vars):
                     self.C_Vars.remove(var)
             s = self.listToDeclare(self.C_IntVars)
-            self.c_proc.insert (start_var, "    int " + s + ";\n")
+            self.c_proc.insert(start_var, "    int " + s + ";\n")
             fLine = True
             start_var += 1
-            
-        if (len(self.C_Vars) > 0):
+
+        if(len(self.C_Vars) > 0):
             s = self.listToDeclare(self.C_Vars)
-            self.c_proc.insert (start_var, "    double " + s + ";\n")
+            self.c_proc.insert(start_var, "    double " + s + ";\n")
             fLine = True
             start_var += 1
-#        if (len(self.C_IntVars) > 0):
+#        if(len(self.C_IntVars) > 0):
 #            s = self.listToDeclare(self.C_IntVars)
-#            self.c_proc.insert (start_var, "    int " + s + ";\n")
+#            self.c_proc.insert(start_var, "    int " + s + ";\n")
 #            fLine = True
 #            start_var += 1
-        if (len (self.C_Vectors) > 0):
+        if(len(self.C_Vectors) > 0):
             s = self.listToDeclare(self.C_Vectors)
             for n in range(len(self.C_Vectors)):
                 name = "vec" + str(n+1)
                 c_dcl = "    double " + name + "[] = {" + self.C_Vectors[n] + "};"
-                self.c_proc.insert (start_var, c_dcl + "\n")
+                self.c_proc.insert(start_var, c_dcl + "\n")
                 start_var += 1
         self.C_Vars.clear()
@@ -404,6 +414,6 @@
         self.C_Pointers.clear()
         self.C_DclPointers
-        if (fLine == True):
-            self.c_proc.insert (start_var, "\n")
+        if(fLine == True):
+            self.c_proc.insert(start_var, "\n")
         return
         s = ''
@@ -412,43 +422,43 @@
             if n < len(self.C_Vars) - 1:
                 s += ", "
-        if (len(s) > 0):
-            self.c_proc.insert (start_var, "    double " + s + ";\n")
-            self.c_proc.insert (start_var + 1, "\n")
-
-    def writeInclude (self):
-        if (self.MathIncludeed == False):
+        if(len(s) > 0):
+            self.c_proc.insert(start_var, "    double " + s + ";\n")
+            self.c_proc.insert(start_var + 1, "\n")
+
+    def writeInclude(self):
+        if(self.MathIncludeed == False):
             self.add_c_line("#include <math.h>\n")
             self.add_c_line("static double pi = 3.14159265359;\n")
             self.MathIncludeed = True
 
-    def ListToString (self, strings):
+    def ListToString(self, strings):
         s = ''
         for n in range(len(strings)):
             s += strings[n]
-            if (n < (len(strings) - 1)):
+            if(n < (len(strings) - 1)):
                 s += ", "
-        return (s)
-
-    def getMethodSignature (self):
-#        args_str = ListToString (self.arguments)
+        return(s)
+
+    def getMethodSignature(self):
+#        args_str = ListToString(self.arguments)
         args_str = ''
         for n in range(len(self.arguments)):
             args_str += "double " + self.arguments[n]
-            if (n < (len(self.arguments) - 1)):
+            if(n < (len(self.arguments) - 1)):
                 args_str += ", "
-        return (args_str)
-#        self.strMethodSignature = 'double ' + self.name + ' (' + args_str + ")"
-
-    def InsertSignature (self):
+        return(args_str)
+#        self.strMethodSignature = 'double ' + self.name + '(' + args_str + ")"
+
+    def InsertSignature(self):
         args_str = ''
         for n in range(len(self.arguments)):
             args_str += "double " + self.arguments[n]
-            if (self.arguments[n] in self.C_Pointers):
+            if(self.arguments[n] in self.C_Pointers):
                 args_str += "[]"
-            if (n < (len(self.arguments) - 1)):
+            if(n < (len(self.arguments) - 1)):
                 args_str += ", "
-        self.strMethodSignature = 'double ' + self.name + ' (' + args_str + ")"
-        if (self.signature_line >= 0):
-            self.c_proc.insert (self.signature_line, self.strMethodSignature)
+        self.strMethodSignature = 'double ' + self.name + '(' + args_str + ")"
+        if(self.signature_line >= 0):
+            self.c_proc.insert(self.signature_line, self.strMethodSignature)
 
     def visit_FunctionDef(self, node):
@@ -466,5 +476,5 @@
 # for C
         self.writeInclude()
-        self.getMethodSignature ()
+        self.getMethodSignature()
 # for C
         self.signature_line = len(self.c_proc)
@@ -474,6 +484,6 @@
         self.body(node.body)
         self.add_c_line("}\n")
-        self.InsertSignature ()
-        self.insert_C_Vars (start_vars)
+        self.InsertSignature()
+        self.insert_C_Vars(start_vars)
         self.C_Pointers = []
 
@@ -522,5 +532,5 @@
             if len(else_) == 0:
                 break
-#            elif hasattr (else_, 'orelse'):
+#            elif hasattr(else_, 'orelse'):
             elif len(else_) == 1 and isinstance(else_[0], ast.If):
                 node = else_[0]
@@ -530,5 +540,5 @@
                 self.write_c(' {')
                 self.body(node.body)
-                self.add_current_line ()
+                self.add_current_line()
                 self.add_c_line('}')
 #                break
@@ -540,20 +550,20 @@
                 break
 
-    def getNodeLineNo (self, node):
+    def getNodeLineNo(self, node):
         line_number = -1
-        if (hasattr (node,'value')):
+        if(hasattr(node,'value')):
             line_number = node.value.lineno
         elif hasattr(node,'iter'):
             if hasattr(node.iter,'lineno'):
                 line_number = node.iter.lineno
-        return (line_number)
-
-    def GetNodeAsString (self, node):
+        return(line_number)
+
+    def GetNodeAsString(self, node):
         res = ''
-        if (hasattr(node,'n')):
+        if(hasattr(node, 'n')):
             res = str(node.n)
-        elif (hasattr(node,'id')):
+        elif(hasattr(node, 'id')):
             res = node.id
-        return (res)
+        return(res)
 
     def GetForRange(self, node):
@@ -569,10 +579,10 @@
             self.current_statement = ''
         self.current_statement = temp_statement
-        if (len(for_args) == 1):
+        if(len(for_args) == 1):
             stop = for_args[0]
-        elif (len(for_args) == 2):
+        elif(len(for_args) == 2):
             start = for_args[0]
             stop = for_args[1]
-        elif (len(for_args) == 3):
+        elif(len(for_args) == 3):
             start = for_args[0]
             stop = for_args[1]
@@ -580,5 +590,5 @@
         else:
             raise("Ilegal for loop parameters")
-        return (start, stop, step)
+        return(start, stop, step)
 
     def visit_For(self, node):
@@ -586,26 +596,26 @@
 # Iterator name is in node.target.id.
         self.add_current_line()
-#        if (len(self.current_statement) > 0):
+#        if(len(self.current_statement) > 0):
 #            self.add_c_line(self.current_statement)
 #            self.current_statement = ''
         fForDone = False
         self.current_statement = ''
-        if (hasattr(node.iter,'func')):
-            if (hasattr (node.iter.func,'id')):
-                if (node.iter.func.id == 'range'):
+        if(hasattr(node.iter, 'func')):
+            if(hasattr(node.iter.func, 'id')):
+                if(node.iter.func.id == 'range'):
                     self.visit(node.target)
                     iterator = self.current_statement
                     self.current_statement = ''
-                    if (iterator not in self.C_IntVars):
-                        self.C_IntVars.append (iterator)
+                    if(iterator not in self.C_IntVars):
+                        self.C_IntVars.append(iterator)
                     start, stop, step = self.GetForRange(node)
-                    self.write_c ("for (" + iterator + "=" + str(start) + \
+                    self.write_c("for(" + iterator + "=" + str(start) + \
                                   " ; " + iterator + " < " + str(stop) + \
                                   " ; " + iterator + " += " + str(step) + ") {")
                     self.body_or_else(node)
-                    self.write_c ("}")
+                    self.write_c("}")
                     fForDone = True
-        if (fForDone == False):
-            line_number = self.getNodeLineNo (node)
+        if(fForDone == False):
+            line_number = self.getNodeLineNo(node)
             self.current_statement = ''
             self.write_c('for ')
@@ -614,5 +624,5 @@
             self.visit(node.iter)
             self.write_c(':')
-            errStr = "Conversion Error in function " + self.name + ", Line #" + str (line_number)
+            errStr = "Conversion Error in function " + self.name + ", Line #" + str(line_number)
             errStr += "\nPython for expression not supported: '" + self.current_statement + "'"
             raise Exception(errStr)
@@ -640,5 +650,5 @@
 
     def visit_Print(self, node):
-# XXX: python 2.6 only 
+# XXX: python 2.6 only
         self.newline(node)
         self.write_c('print ')
@@ -692,9 +702,9 @@
             self.write_c('return')
         else:
-            self.write_c('return (')
+            self.write_c('return(')
             self.visit(node.value)
         self.write_c(');')
-#      self.add_current_statement (self)
-        self.add_c_line (self.current_statement)
+#      self.add_current_statement(self)
+        self.add_c_line(self.current_statement)
         self.current_statement = ''
 
@@ -729,5 +739,5 @@
 
     def visit_Attribute(self, node):
-        errStr = "Conversion Error in function " + self.name + ", Line #" + str (node.value.lineno)
+        errStr = "Conversion Error in function " + self.name + ", Line #" + str(node.value.lineno)
         errStr += "\nPython expression not supported: '" + node.value.id + "." + node.attr + "'"
         raise Exception(errStr)
@@ -742,13 +752,13 @@
             else:
                 want_comma.append(True)
-        if (hasattr (node.func, 'id')):
-            if (node.func.id not in self.C_Functions):
-                self.C_Functions.append (node.func.id)
-            if (node.func.id == 'abs'):
-                self.write_c ("fabs ")
-            elif (node.func.id == 'int'):
+        if(hasattr(node.func, 'id')):
+            if(node.func.id not in self.C_Functions):
+                self.C_Functions.append(node.func.id)
+            if(node.func.id == 'abs'):
+                self.write_c("fabs ")
+            elif(node.func.id == 'int'):
                 self.write_c('(int) ')
-            elif (node.func.id == "SINCOS"):
-                self.WriteSincos (node)
+            elif(node.func.id == "SINCOS"):
+                self.WriteSincos(node)
                 return
             else:
@@ -760,5 +770,5 @@
         for arg in node.args:
             write_comma()
-            self.visited_args = True 
+            self.visited_args = True
             self.visit(arg)
         for keyword in node.keywords:
@@ -766,10 +776,10 @@
             self.write_c(keyword.arg + '=')
             self.visit(keyword.value)
-        if hasattr (node, 'starargs'):
+        if hasattr(node, 'starargs'):
             if node.starargs is not None:
                 write_comma()
                 self.write_c('*')
                 self.visit(node.starargs)
-        if hasattr (node, 'kwargs'):
+        if hasattr(node, 'kwargs'):
             if node.kwargs is not None:
                 write_comma()
@@ -780,18 +790,20 @@
     def visit_Name(self, node):
         self.write_c(node.id)
-        if ((node.id in self.C_Pointers) and (not self.SubRef)):
+        if((node.id in self.C_Pointers) and(not self.SubRef)):
             self.write_c("[0]")
         name = ""
         sub = node.id.find("[")
-        if (sub > 0):
+        if(sub > 0):
             name = node.id[0:sub].strip()
         else:
             name = node.id
 #       add variable to C_Vars if it ins't there yet, not an argument and not a number
-        if ((name not in self.C_Functions) and (name not in self.C_Vars) and (name not in self.C_IntVars) and (name not in self.arguments) and (name.isnumeric () == False)):
-            if (self.InSubscript):
-                self.C_IntVars.append (node.id)
+        if((name not in self.C_Functions) and (name not in self.C_Vars) and \
+            (name not in self.C_IntVars) and (name not in self.arguments) and \
+            (name.isnumeric() == False)):
+            if(self.InSubscript):
+                self.C_IntVars.append(node.id)
             else:
-                self.C_Vars.append (node.id)
+                self.C_Vars.append(node.id)
 
     def visit_Str(self, node):
@@ -816,12 +828,12 @@
             s = ""
             for idx, item in enumerate(node.elts):
-                if ((idx > 0) and (len(s) > 0)):
+                if((idx > 0) and(len(s) > 0)):
                     s += ', '
-                if (hasattr (item, 'id')):
+                if(hasattr(item, 'id')):
                     s += item.id
-                elif (hasattr(item,'n')):
+                elif(hasattr(item, 'n')):
                     s += str(item.n)
-            if (len(s) > 0):
-                self.C_Vectors.append (s)
+            if(len(s) > 0):
+                self.C_Vectors.append(s)
                 vec_name = "vec"  + str(len(self.C_Vectors))
                 self.write_c(vec_name)
@@ -843,24 +855,24 @@
         self.write_python('}')
 
-    def get_special_power (self, string):
+    def get_special_power(self, string):
         function_name = ''
         is_negative_exp = False
-        if (isevaluable(str(self.current_statement))):
+        if(isevaluable(str(self.current_statement))):
             exponent = eval(string)
             is_negative_exp = exponent < 0
             abs_exponent = abs(exponent)
-            if (abs_exponent == 2):
+            if(abs_exponent == 2):
                 function_name = "square"
-            elif (abs_exponent == 3):
+            elif(abs_exponent == 3):
                 function_name = "cube"
-            elif (abs_exponent == 0.5):
+            elif(abs_exponent == 0.5):
                 function_name = "sqrt"
-            elif (abs_exponent == 1.0/3.0):
+            elif(abs_exponent == 1.0/3.0):
                 function_name = "cbrt"
-        if (function_name == ''):
+        if(function_name == ''):
             function_name = "pow"
         return function_name, is_negative_exp
 
-    def translate_power (self, node):
+    def translate_power(self, node):
 # get exponent by visiting the right hand argument.
         function_name = "pow"
@@ -871,32 +883,32 @@
         self.current_statement = ''
         self.visit(node.right)
-        exponent = self.current_statement.replace(' ','')
-        function_name, is_negative_exp = self.get_special_power (self.current_statement)
+        exponent = self.current_statement.replace(' ', '')
+        function_name, is_negative_exp = self.get_special_power(self.current_statement)
         self.current_statement = temp_statement
-        if (is_negative_exp):
-            self.write_c ("1.0 / (")
-        self.write_c (function_name + " (")
+        if(is_negative_exp):
+            self.write_c("1.0 /(")
+        self.write_c(function_name + "(")
         self.visit(node.left)
-        if (function_name == "pow"):
+        if(function_name == "pow"):
             self.write_c(", ")
             self.visit(node.right)
         self.write_c(")")
-        if (is_negative_exp):
+        if(is_negative_exp):
             self.write_c(")")
         self.write_c(" ")
 
-    def translate_integer_divide (self, node):
-        self.write_c ("(int) (")
+    def translate_integer_divide(self, node):
+        self.write_c("(int)(")
         self.visit(node.left)
-        self.write_c (") / (int) (")
+        self.write_c(") /(int)(")
         self.visit(node.right)
-        self.write_c (")")
+        self.write_c(")")
 
     def visit_BinOp(self, node):
         self.write_c("(")
-        if ('%s' % BINOP_SYMBOLS[type(node.op)] == BINOP_SYMBOLS[ast.Pow]):
-            self.translate_power (node)
-        elif ('%s' % BINOP_SYMBOLS[type(node.op)] == BINOP_SYMBOLS[ast.FloorDiv]):
-            self.translate_integer_divide (node)
+        if('%s' % BINOP_SYMBOLS[type(node.op)] == BINOP_SYMBOLS[ast.Pow]):
+            self.translate_power(node)
+        elif('%s' % BINOP_SYMBOLS[type(node.op)] == BINOP_SYMBOLS[ast.FloorDiv]):
+            self.translate_integer_divide(node)
         else:
             self.visit(node.left)
@@ -932,6 +944,6 @@
 
     def visit_Subscript(self, node):
-        if (node.value.id not in self.C_Pointers):
-            self.C_Pointers.append (node.value.id)
+        if(node.value.id not in self.C_Pointers):
+            self.C_Pointers.append(node.value.id)
         self.SubRef = True
         self.visit(node.value)
@@ -951,5 +963,5 @@
         if node.step is not None:
             self.write_python(':')
-            if not (isinstance(node.step, Name) and node.step.id == 'None'):
+            if not(isinstance(node.step, Name) and node.step.id == 'None'):
                 self.visit(node.step)
 
@@ -1048,23 +1060,23 @@
 
 def Iq1(q, porod_scale, porod_exp, lorentz_scale, lorentz_length, peak_pos, lorentz_exp=17):
-    z1 = z2 = z = abs (q - peak_pos) * lorentz_length
-    if (q > p):
+    z1 = z2 = z = abs(q - peak_pos) * lorentz_length
+    if(q > p):
         q = p + 17
         p = q - 5
     z3 = -8
     inten = (porod_scale / q ** porod_exp
-                + lorentz_scale / (1 + z ** lorentz_exp))
+                + lorentz_scale /(1 + z ** lorentz_exp))
     return inten
 
 def Iq(q, porod_scale, porod_exp, lorentz_scale, lorentz_length, peak_pos, lorentz_exp=17):
-    z1 = z2 = z = abs (q - peak_pos) * lorentz_length
-    if (q > p):
+    z1 = z2 = z = abs(q - peak_pos) * lorentz_length
+    if(q > p):
         q = p + 17
         p = q - 5
-    elif (q == p):
+    elif(q == p):
         q = p * q
         q *= z1
         p = z1
-    elif (q == 17):
+    elif(q == 17):
         q = p * q - 17
     else:
@@ -1072,5 +1084,5 @@
     z3 = -8
     inten = (porod_scale / q ** porod_exp
-                + lorentz_scale / (1 + z ** lorentz_exp))
+                + lorentz_scale /(1 + z ** lorentz_exp))
     return inten
 
@@ -1084,32 +1096,32 @@
     if f is not None:
         tree = ast.parse(inspect.getsource(f))
-        tree_source = to_source (tree)
+        tree_source = to_source(tree)
         print(tree_source)
 
-def translate (functions, constants=0):
+def translate(functions, constants=0):
     sniplets = []
     fname = functions[1]
-    python_file = open (fname, "r")
+    python_file = open(fname, "r")
     source = python_file.read()
     python_file.close()
-    tree = ast.parse (source)
-    sniplet = to_source (tree, functions) # in the future add filename, offset, constants
+    tree = ast.parse(source)
+    sniplet = to_source(tree, functions) # in the future add filename, offset, constants
     sniplets.append(sniplet)
-    return ("\n".join(sniplets))
-
-def get_file_names ():
+    return("\n".join(sniplets))
+
+def get_file_names():
     fname_in = ""
     fname_out = ""
-    if (len(sys.argv) > 1):
+    if(len(sys.argv) > 1):
         fname_in = sys.argv[1]
-        fname_base = os.path.splitext (fname_in)
-        if (len (sys.argv) == 2):
-            fname_out = str (fname_base[0]) + '.c'
+        fname_base = os.path.splitext(fname_in)
+        if(len(sys.argv) == 2):
+            fname_out = str(fname_base[0]) + '.c'
         else:
             fname_out = sys.argv[2]
-        if (len (fname_in) > 0):
-            python_file = open (sys.argv[1], "r")
-            if (len (fname_out) > 0):
-                file_out = open (fname_out, "w+")
+        if(len(fname_in) > 0):
+            python_file = open(sys.argv[1], "r")
+            if(len(fname_out) > 0):
+                file_out = open(fname_out, "w+")
     return len(sys.argv), fname_in, fname_out
 
@@ -1120,23 +1132,23 @@
         fname_in = ""
         fname_out = ""
-        if (len (sys.argv) == 1):
-            print ("Usage:\npython parse01.py <infile> [<outfile>] (if omitted, output file is '<infile>.c'")
+        if(len(sys.argv) == 1):
+            print("Usage:\npython parse01.py <infile> [<outfile>](if omitted, output file is '<infile>.c'")
         else:
             fname_in = sys.argv[1]
-            fname_base = os.path.splitext (fname_in)
-            if (len (sys.argv) == 2):
-                fname_out = str (fname_base[0]) + '.c'
+            fname_base = os.path.splitext(fname_in)
+            if(len(sys.argv) == 2):
+                fname_out = str(fname_base[0]) + '.c'
             else:
                 fname_out = sys.argv[2]
-            if (len (fname_in) > 0):
-                python_file = open (sys.argv[1], "r")
-                if (len (fname_out) > 0):
-                    file_out = open (fname_out, "w+")
+            if(len(fname_in) > 0):
+                python_file = open(sys.argv[1], "r")
+                if(len(fname_out) > 0):
+                    file_out = open(fname_out, "w+")
                 functions = ["MultAsgn", "Iq41", "Iq2"]
                 tpls = [functions, fname_in, 0]
-                c_txt = translate (tpls)
-                file_out.write (c_txt)
+                c_txt = translate(tpls)
+                file_out.write(c_txt)
                 file_out.close()
     except Exception as excp:
-        print ("Error:\n" + str(excp.args))
+        print("Error:\n" + str(excp.args))
     print("...Done")
