Index: sansmodels/src/sans/models/AddComponent.py
===================================================================
--- sansmodels/src/sans/models/AddComponent.py	(revision ae3ce4eaa593202ebf49122e196897c0d45a25b6)
+++ sansmodels/src/sans/models/AddComponent.py	(revision 3db389570c206a21d9ba5706da8726e27ff899b6)
@@ -38,4 +38,12 @@
         return self.operateOn.run(x) + self.other.run(x)
         
+    def runXY(self, x=0):
+        """
+            Evaluate each part of the component and sum the results
+            @param x: input parameter
+            @return: value of the model at x
+        """
+        return self.operateOn.runXY(x) + self.other.runXY(x)
+        
     def setParam(self, name, value):
         """ 
Index: sansmodels/src/sans/models/BEPolyelectrolyte.py
===================================================================
--- sansmodels/src/sans/models/BEPolyelectrolyte.py	(revision 829eee9c87a25f8870f8613d915daf0cfa4c4d05)
+++ sansmodels/src/sans/models/BEPolyelectrolyte.py	(revision 3db389570c206a21d9ba5706da8726e27ff899b6)
@@ -2,5 +2,5 @@
 """ 
     
-    Provide F(x) = K*1/(4*pi()*Lb*(alpha)^(2)*(q^(2)+k2)/(1+(r02)^(2))*(q^(2)+k2)\
+    Provide F(x) = K*1/(4*pi*Lb*(alpha)^(2))*(q^(2)+k2)/(1+(r02)^(2))*(q^(2)+k2)\
                        *(q^(2)-(12*h*C/b^(2)))
     BEPolyelectrolyte as a BaseComponent model
@@ -15,5 +15,5 @@
         Class that evaluates a BEPolyelectrolyte.
         
-        F(x) = K*1/(4*pi()*Lb*(alpha)^(2)*(q^(2)+k2)/(1+(r02)^(2))*(q^(2)+k2)\
+        F(x) = K*1/(4*pi*Lb*(alpha)^(2))*(q^(2)+k2)/(1+(r02)^(2))*(q^(2)+k2)\
                        *(q^(2)-(12*h*C/b^(2)))
         
@@ -40,24 +40,24 @@
         ## Define parameters
         self.params = {}
-        self.params['K']    = 10
-        self.params['Lb']   = 7.1
-        self.params['H']    = 12
-        self.params['B']    = 10
-        self.params['Cs']   = 0.0
+        self.params['k']    = 10
+        self.params['lb']   = 7.1
+        self.params['h']    = 12
+        self.params['b']    = 10
+        self.params['cs']   = 0.0
         self.params['alpha']= 0.05
-        self.params['C']    = 0.7
-        self.params['bkd']  = 0.001
+        self.params['c']    = 0.7
+        self.params['background']  = 0.0
         
 
         ## Parameter details [units, min, max]
         self.details = {}
-        self.details['K']    = ['barns', None, None]
-        self.details['Lb'] = ['A', None, None]
-        self.details['H']   = ['A^{-3}', None, None]
-        self.details['B']    = ['A', None, None]
-        self.details['Cs'] = ['mol/L', None, None]
+        self.details['k']    = ['barns', None, None]
+        self.details['lb'] = ['A', None, None]
+        self.details['h']   = ['A-3', None, None]
+        self.details['b']    = ['A', None, None]
+        self.details['cs'] = ['mol/L', None, None]
         self.details['alpha']   = ['', None, None]
-        self.details['C']    = ['mol/L', None, None]
-        self.details['bkd'] = ['', None, None]
+        self.details['c']    = ['mol/L', None, None]
+        self.details['background'] = ['cm-1', None, None]
        
                
@@ -65,5 +65,5 @@
         """
             Evaluate  
-            F(x) = K*1/(4*pi()*Lb*(alpha)^(2)*(q^(2)+k2)/(1+(r02)^(2))*(q^(2)+k2)\
+            F(x) = K*1/(4*pi*Lb*(alpha)^(2))*(q^(2)+k2)/(1+(r02)^(2))*(q^(2)+k2)\
                        *(q^(2)-(12*h*C/b^(2)))
         
@@ -71,24 +71,24 @@
                    The inverse Debye Length: K2 = 4*pi*Lb*(2*Cs+alpha*C)
                    r02 =1/alpha/Ca^(0.5)*(B/(48*pi*Lb)^(0.5))
-                   Ca = C*6.022136* exp(-4)
+                   Ca = C*6.022136e-4
         """
-        K2 = 4 * math.pi * self.params['Lb'] * (2*self.params['Cs'] + \
-                 self.params['alpha'] * self.params['C'])
+        Ca = self.params['c'] * 6.022136e-4
         
-        Ca = self.params['C'] * 6.022136 * math.exp(-4)
+        K2 = 4.0 * math.pi * self.params['lb'] * (2*self.params['cs'] + \
+                 self.params['alpha'] * Ca)
         
-        r02 =1/(self.params['alpha'] * math.pow(Ca,0.5) * \
-                (self.params['B']/math.pow((48*math.pi *self.params['Lb']),0.5)))
+        r02 = 1.0/self.params['alpha']/math.sqrt(Ca) * \
+                (self.params['b']/math.sqrt((48.0*math.pi *self.params['lb'])))
         
-        return ( self.params['K']/( ( 4 * math.pi *self.params['Lb']*\
-                (self.params['alpha']**2)*\
-                 ( x**2 + K2 )*( 1 + r02**2 ) * ( x**2 + K2 ) *\
-                 (x**2 - ( 12 * self.params['H'] * \
-                  self.params['C']/(self.params['B']**2) ))  )))+  self.params['bkd']
+        return self.params['k']/( 4.0 * math.pi * self.params['lb'] * self.params['alpha']**2 ) \
+               * ( x**2 + K2 ) / ( 1.0 + r02**2 * ( x**2 + K2 ) \
+                    * (x**2 - ( 12.0 * self.params['h'] \
+                    * Ca/(self.params['b']**2) ))) \
+                    + self.params['background']
         
    
     def run(self, x = 0.0):
         """ Evaluate the model
-            @param x: simple value
+            @param x: input q-value (float or [float, float] as [r, theta])
             @return: (debye value)
         """
@@ -102,5 +102,5 @@
     def runXY(self, x = 0.0):
         """ Evaluate the model
-            @param x: simple value
+            @param x: input q-value (float or [float, float] as [qx, qy])
             @return: debye value
         """
@@ -110,3 +110,3 @@
             raise ValueError, "Tuples are not allowed as input to BaseComponent models"
         else:
-            return self._BEPolye(x)
+            return self._BEPoly(x)
Index: sansmodels/src/sans/models/BaseComponent.py
===================================================================
--- sansmodels/src/sans/models/BaseComponent.py	(revision ae3ce4eaa593202ebf49122e196897c0d45a25b6)
+++ sansmodels/src/sans/models/BaseComponent.py	(revision 3db389570c206a21d9ba5706da8726e27ff899b6)
@@ -47,4 +47,5 @@
         ## Parameters to be accessed by client
         self.params = {}
+        self.details = {}
            
     def __str__(self):
@@ -67,4 +68,5 @@
         obj = copy.deepcopy(self)
         obj.params = copy.deepcopy(self.params)
+        obj.details = copy.deepcopy(self.details)
     
         # Check for standard data members of arithmetics sub-classes
Index: sansmodels/src/sans/models/DABModel.py
===================================================================
--- sansmodels/src/sans/models/DABModel.py	(revision 829eee9c87a25f8870f8613d915daf0cfa4c4d05)
+++ sansmodels/src/sans/models/DABModel.py	(revision 3db389570c206a21d9ba5706da8726e27ff899b6)
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
 """ 
-    Provide F(x) = scale/( 1 + (x*L)^2 )^(2)
+    Provide F(x) = scale/( 1 + (x*L)^2 )^(2) + background
     DAB (Debye Anderson Brumberger) function as a BaseComponent model
 """
@@ -13,10 +13,10 @@
         Class that evaluates a DAB model.
         
-        F(x) = scale/( 1 + (x*L)^2 )^(2) +bkd
+        F(x) = scale/( 1 + (x*L)^2 )^(2) + background
         
         The model has three parameters: 
-            L     =  Correlation Length
-            scale  =  scale factor
-            bkd    =  incoherent background
+            L             =  Correlation Length
+            scale         =  scale factor
+            background    =  incoherent background
     """
         
@@ -28,30 +28,30 @@
         
         ## Name of the model
-        self.name = " DAB_Model "
+        self.name = "DAB_Model"
 
         ## Define parameters
         self.params = {}
-        self.params['L']     = 40.0
-        self.params['scale'] = 10.0
-        self.params['bkd']   = 0.0
+        self.params['length']             = 50.0
+        self.params['scale']              = 1.0
+        self.params['background']         = 0.0
 
         ## Parameter details [units, min, max]
         self.details = {}
-        self.details['L']    = ['A', None, None]
-        self.details['scale'] = ['', None, None]
-        self.details['bkd']   = ['cm^{-1}', None, None]
+        self.details['length']            = ['', None, None]
+        self.details['scale']             = ['', None, None]
+        self.details['background']        = ['', None, None]
                
     def _DAB(self, x):
         """
-            Evaluate  F(x) = scale/( 1 + (x*L)^2 )^(2) + bkd
+            Evaluate  F(x) = scale/( 1 + (x*L)^2 )^(2) + background
            
         """
-        return self.params['scale']/math.pow(( 1 + math.pow(x * self.params['L'],2)),2) \
-         + self.params['bkd']
+        return self.params['scale']/math.pow(( 1 + math.pow(x * self.params['length'],2)),2) \
+         + self.params['background']
        
    
     def run(self, x = 0.0):
         """ Evaluate the model
-            @param x: simple value
+            @param x: input q-value (float or [float, float] as [r, theta])
             @return: (DAB value)
         """
@@ -65,5 +65,5 @@
     def runXY(self, x = 0.0):
         """ Evaluate the model
-            @param x: simple value
+            @param x: input q-value (float or [float, float] as [qx, qy])
             @return: DAB value
         """
Index: sansmodels/src/sans/models/DebyeModel.py
===================================================================
--- sansmodels/src/sans/models/DebyeModel.py	(revision 829eee9c87a25f8870f8613d915daf0cfa4c4d05)
+++ sansmodels/src/sans/models/DebyeModel.py	(revision 3db389570c206a21d9ba5706da8726e27ff899b6)
@@ -1,5 +1,7 @@
 #!/usr/bin/env python
 """ 
-    Provide F(x) = 2( exp(-x)+x -1 )/x**2
+    Provide F(x) = 2( exp(-x) + x - 1 )/x**2
+    with x = (q*R_g)**2
+    
     Debye function as a BaseComponent model
 """
@@ -13,5 +15,6 @@
         Class that evaluates a Debye model.
         
-        F(x) = 2( exp(-x)+x -1 )/x**2
+        F(x) = 2( exp(-x) + x - 1 )/x**2
+        with x = (q*R_g)**2
         
         The model has three parameters: 
@@ -32,13 +35,13 @@
         ## Define parameters
         self.params = {}
-        self.params['Rg']    = 50.0
-        self.params['scale'] = 1.0
-        self.params['bkd']   = 0.001
+        self.params['rg']          = 50.0
+        self.params['scale']       = 1.0
+        self.params['background']  = 0.0
 
         ## Parameter details [units, min, max]
         self.details = {}
-        self.details['Rg']    = ['A', None, None]
-        self.details['scale'] = ['', None, None]
-        self.details['bkd']   = ['cm^{-1}', None, None]
+        self.details['rg']         = ['', None, None]
+        self.details['scale']      = ['', None, None]
+        self.details['background'] = ['', None, None]
                
     def _debye(self, x):
@@ -46,18 +49,16 @@
             Evaluate F(x)= scale * D + bkd
             has 2 internal parameters :
-                    D = 2 * (exp(-y) +x -1)/y**2 
+                    D = 2 * (exp(-y) + y - 1)/y**2 
                     y = (x * Rg)^(2)
         """
-        # prevent a value zero in the denominator 
-        if x != 0.0 :
-            y = math.pow((x * self.params['Rg']), 2)
-            D = 2*( math.exp(-y) + y -1 )/math.pow(y,2)
-            return self.params['scale']* D + self.params['bkd']
-        else: 
-            return False
+        # Note that a zero denominator value will raise
+        # an exception
+        y = math.pow((x * self.params['rg']), 2)
+        D = 2*( math.exp(-y) + y -1 )/math.pow(y,2)
+        return self.params['scale']* D + self.params['background']
    
     def run(self, x = 0.0):
         """ Evaluate the model
-            @param x: simple value
+            @param x: input q-value (float or [float, float] as [r, theta])
             @return: (debye value)
         """
@@ -71,5 +72,5 @@
     def runXY(self, x = 0.0):
         """ Evaluate the model
-            @param x: simple value
+            @param x: input q-value (float or [float, float] as [qx, qy])
             @return: debye value
         """
Index: sansmodels/src/sans/models/DivComponent.py
===================================================================
--- sansmodels/src/sans/models/DivComponent.py	(revision ae3ce4eaa593202ebf49122e196897c0d45a25b6)
+++ sansmodels/src/sans/models/DivComponent.py	(revision 3db389570c206a21d9ba5706da8726e27ff899b6)
@@ -38,4 +38,12 @@
         return self.operateOn.run(x) / self.other.run(x)
         
+    def runXY(self, x=0):
+        """
+            Evaluate each part of the component and sum the results
+            @param x: input parameter
+            @return: value of the model at x
+        """
+        return self.operateOn.runXY(x) / self.other.runXY(x)
+        
     def setParam(self, name, value):
         """ 
Index: sansmodels/src/sans/models/FractalModel.py
===================================================================
--- sansmodels/src/sans/models/FractalModel.py	(revision 829eee9c87a25f8870f8613d915daf0cfa4c4d05)
+++ sansmodels/src/sans/models/FractalModel.py	(revision 3db389570c206a21d9ba5706da8726e27ff899b6)
@@ -17,11 +17,11 @@
         F(x)= P(x)*S(x) + bkd
         The model has Seven parameters: 
-            scale   =  Volume fraction
-            Radius  =  Block radius
-            Fdim    =  Fractal dimension
-            L       =  correlation Length
-            SDLB    =  SDL block
-            SDLS    =  SDL solvent
-            bkd     =  background
+            scale        =  Volume fraction
+            radius       =  Block radius
+            fractal_dim  =  Fractal dimension
+            corr_length  =  correlation Length
+            block_sld    =  SDL block
+            solvent_sld  =  SDL solvent
+            background   =  background
            
     """
@@ -38,22 +38,22 @@
         ## Define parameters
         self.params = {}
-        self.params['scale'] = 0.05
-        self.params['Radius']= 5
-        self.params['Fdim']  = 2
-        self.params['L']     = 100
-        self.params['SDLB']  = 2*math.exp(-6)
-        self.params['SDLS']  = 6.35*math.exp(-6)
-        self.params['bkd']   = 0.0
+        self.params['scale']       = 0.05
+        self.params['radius']      = 5.0
+        self.params['fractal_dim'] = 2.0
+        self.params['corr_length'] = 100.0
+        self.params['block_sld']   = 2.0e-6
+        self.params['solvent_sld'] = 6.0e-6
+        self.params['background']  = 0.0
         
 
         ## Parameter details [units, min, max]
         self.details = {}
-        self.details['scale']    = ['', None, None]
-        self.details['Radius']   = ['A', None, None]
-        self.details['Fdim']     = ['', None, None]
-        self.details['L']        = ['A', None, None]
-        self.details['SDLB']     = ['A^{-2}', None, None]
-        self.details['SDLS']     = ['A^{-2}', None, None]
-        self.details['bkd']      = ['cm^{-1} sr^{-1}', None, None]
+        self.details['scale']       = ['', None, None]
+        self.details['radius']      = ['A', None, None]
+        self.details['fractal_dim'] = ['', None, None]
+        self.details['corr_length'] = ['A', None, None]
+        self.details['block_sld']   = ['A-2', None, None]
+        self.details['solvent_sld'] = ['A-2', None, None]
+        self.details['background']  = ['cm-1', None, None]
        
                
@@ -61,14 +61,14 @@
         """
             Evaluate  
-            F(x) = p(x)* s(x)+bkd  
+            F(x) = p(x) * s(x) + bkd  
         """
-        return self.params['bkd']+ self._scatterRanDom(x)* self._Block(x)
+        return self.params['background']+ self._scatterRanDom(x)* self._Block(x)
     
     def _Block(self,x):
         
-        return 1 + (math.sin((self.params['Fdim']-1) * math.atan(x * self.params['L']))\
-             * self.params['Fdim'] * gamma(self.params['Fdim']-1))\
-           /( math.pow( (x*self.params['Radius']),self.params['Fdim'])*\
-           ( 1 + 1/math.pow(((x**2)*(self.params['L']**2)),(self.params['Fdim']-1)/2)))      
+        return 1.0 + (math.sin((self.params['fractal_dim']-1.0) * math.atan(x * self.params['corr_length']))\
+             * self.params['fractal_dim'] * gamma(self.params['fractal_dim']-1.0))\
+           /( math.pow( (x*self.params['radius']),self.params['fractal_dim'])*\
+           ( 1.0 + 1.0/((x**2)*(self.params['corr_length']**2)),(self.params['fractal_dim']-1.0)/2.0))      
            
     def _Spherical(self,x):
@@ -76,21 +76,19 @@
             F(x) = [sin(x)-xcos(x)]/3*(x**3)
         """
-        if x !=0:
-            return (math.sin(x)-x*math.cos(x))/(3*math.pow(x,3))
-        else:
-            return false
+        return (math.sin(x)-x*math.cos(x))/(3.0*math.pow(x,3.0))
+        
     def _scatterRanDom(self,x):
         """
              calculate p(x)= scale* V^(2)*delta^(2)* F(x*Radius)^(2)
         """
-        V =(4/3)*math.pi* math.pow(self.params['Radius'],3) 
-        delta = self.params['SDLB']-self.params['SDLS']
+        V =(4.0/3.0)*math.pi* math.pow(self.params['radius'],3.0) 
+        delta = self.params['block_sld']-self.params['solvent_sld']
         
-        return self.params['scale']* (V**2)*(delta**2)*\
-                (self._Spherical(x*self.params['Radius'])**2)
+        return self.params['scale']* V *(delta**2)*\
+                (self._Spherical(x*self.params['radius'])**2)
         
     def run(self, x = 0.0):
         """ Evaluate the model
-            @param x: simple value
+            @param x: input q-value (float or [float, float] as [r, theta])
             @return: (Fractal value)
         """
@@ -104,5 +102,5 @@
     def runXY(self, x = 0.0):
         """ Evaluate the model
-            @param x: simple value
+            @param x: input q-value (float or [float, float] as [qx, qy])
             @return: Fractal value
         """
Index: sansmodels/src/sans/models/GuinierModel.py
===================================================================
--- sansmodels/src/sans/models/GuinierModel.py	(revision 829eee9c87a25f8870f8613d915daf0cfa4c4d05)
+++ sansmodels/src/sans/models/GuinierModel.py	(revision 3db389570c206a21d9ba5706da8726e27ff899b6)
@@ -1,4 +1,6 @@
 #!/usr/bin/env python
-""" Provide y=exp (ax^(2)+b),Guinier function as a BaseComponent model
+""" 
+    Provide I(q) = I_0 exp ( - R_g^2 q^2 / 3.0)
+    Guinier function as a BaseComponent model
 """
 
@@ -7,10 +9,13 @@
 
 class GuinierModel(BaseComponent):
-    """ Class that evaluates a Guinier model.
+    """ 
+        Class that evaluates a Guinier model.
     
-        Info about the model
+        I(q) = I_0 exp ( - R_g^2 q^2 / 3.0 )
      
         List of default parameters:
-         value           = 1.0 
+         I_0 = Scale
+         R_g = Radius of gyration
+          
     """
         
@@ -26,18 +31,18 @@
         ## Define parameters
         self.params = {}
-        self.params['A'] = 0.0
-        self.params['B'] = 0.0
+        self.params['scale']  = 1.0
+        self.params['rg']     = 0.1
 
         ## Parameter details [units, min, max]
         self.details = {}
-        self.details['A'] = ['', None, None]
-        self.details['B'] = ['', None, None]
+        self.details['scale'] = ['cm-1', None, None]
+        self.details['rg']    = ['A', None, None]
                
     def _guinier(self, x):
-        return math.exp(self.params['A'] + self.params['B']* math.pow(x, 2))  
+        return self.params['scale'] * math.exp( -(self.params['rg']*x)**2 / 3.0 )  
    
     def run(self, x = 0.0):
         """ Evaluate the model
-            @param x: simple value
+            @param x: input q-value (float or [float, float] as [r, theta])
             @return: (guinier value)
         """
@@ -51,5 +56,5 @@
     def runXY(self, x = 0.0):
         """ Evaluate the model
-            @param x: simple value
+            @param x: input q-value (float or [float, float] as [qx, qy])
             @return: guinier value
         """
Index: sansmodels/src/sans/models/LorentzModel.py
===================================================================
--- sansmodels/src/sans/models/LorentzModel.py	(revision 829eee9c87a25f8870f8613d915daf0cfa4c4d05)
+++ sansmodels/src/sans/models/LorentzModel.py	(revision 3db389570c206a21d9ba5706da8726e27ff899b6)
@@ -2,5 +2,5 @@
 """ 
     Provide F(x) = scale/( 1 + (x*L)^2 ) + bkd
-    Lorentz function as a BaseComponent model
+    Lorentz (Ornstein-Zernicke) function as a BaseComponent model
 """
 
@@ -11,5 +11,5 @@
    
     """
-        Class that evaluates a Lorentz model.
+        Class that evaluates a Lorentz (Ornstein-Zernicke) model.
         
         F(x) = scale/( 1 + (x*L)^2 ) + bkd
@@ -32,13 +32,13 @@
         ## Define parameters
         self.params = {}
-        self.params['L']     = 50.0
-        self.params['scale'] = 100.0
-        self.params['bkd']   = 1
+        self.params['length']      = 50.0
+        self.params['scale']       = 1.0
+        self.params['background']  = 0.0
 
         ## Parameter details [units, min, max]
         self.details = {}
-        self.details['L']    = ['A', None, None]
-        self.details['scale'] = ['', None, None]
-        self.details['bkd']   = ['cm^{-1}', None, None]
+        self.details['length']     = ['A', None, None]
+        self.details['scale']      = ['', None, None]
+        self.details['background'] = ['cm-1', None, None]
                
     def _lorentz(self, x):
@@ -47,11 +47,11 @@
            
         """
-        return self.params['scale']/( 1 + math.pow((x * self.params['L']),2))\
-                + self.params['bkd']
+        return self.params['scale']/( 1 + math.pow((x * self.params['length']),2))\
+                + self.params['background']
        
    
     def run(self, x = 0.0):
         """ Evaluate the model
-            @param x: simple value
+            @param x: input q-value (float or [float, float] as [r, theta])
             @return: (Lorentz value)
         """
@@ -65,5 +65,5 @@
     def runXY(self, x = 0.0):
         """ Evaluate the model
-            @param x: simple value
+            @param x: input q-value (float or [float, float] as [qx, qy])
             @return: Lorentz value
         """
Index: sansmodels/src/sans/models/MulComponent.py
===================================================================
--- sansmodels/src/sans/models/MulComponent.py	(revision ae3ce4eaa593202ebf49122e196897c0d45a25b6)
+++ sansmodels/src/sans/models/MulComponent.py	(revision 3db389570c206a21d9ba5706da8726e27ff899b6)
@@ -38,4 +38,12 @@
         return self.operateOn.run(x) * self.other.run(x)
         
+    def runXY(self, x=0):
+        """
+            Evaluate each part of the component and sum the results
+            @param x: input parameter
+            @return: value of the model at x
+        """
+        return self.operateOn.runXY(x) * self.other.runXY(x)
+        
     def setParam(self, name, value):
         """ 
Index: sansmodels/src/sans/models/PorodModel.py
===================================================================
--- sansmodels/src/sans/models/PorodModel.py	(revision 829eee9c87a25f8870f8613d915daf0cfa4c4d05)
+++ sansmodels/src/sans/models/PorodModel.py	(revision 3db389570c206a21d9ba5706da8726e27ff899b6)
@@ -1,4 +1,6 @@
 #!/usr/bin/env python
-""" Provide y=,Guinier function as a BaseComponent model
+""" 
+    Provide I(q) = C/q^4,
+    Porod function as a BaseComponent model
 """
 
@@ -9,7 +11,6 @@
     """ Class that evaluates a Porod model.
     
-       F(x) = exp[ [C]/Q**4 ]
+       I(q) = scale/q^4
         
-        The model has one parameter: C
     """
         
@@ -21,22 +22,22 @@
         
         ## Name of the model
-        self.name = "Porod Model"
+        self.name = "PorodModel"
 
         ## Define parameters
         self.params = {}
-        self.params['C'] = 0.0
+        self.params['scale'] = 0.0
         
 
         ## Parameter details [units, min, max]
         self.details = {}
-        self.details['C'] = ['', None, None]
+        self.details['scale'] = ['', None, None]
       
                
     def _porod(self, x):
-        return math.exp(self.params['C']/ math.pow(x, 4))  
+        return self.params['scale']/x**4.0
    
     def run(self, x = 0.0):
         """ Evaluate the model
-            @param x: simple value
+            @param x: input q-value (float or [float, float] as [r, theta])
             @return: (porod value)
         """
@@ -50,5 +51,5 @@
     def runXY(self, x = 0.0):
         """ Evaluate the model
-            @param x: simple value
+            @param x: input q-value (float or [float, float] as [qx, qy])
             @return: porod value
         """
Index: sansmodels/src/sans/models/PowerLawModel.py
===================================================================
--- sansmodels/src/sans/models/PowerLawModel.py	(revision 829eee9c87a25f8870f8613d915daf0cfa4c4d05)
+++ sansmodels/src/sans/models/PowerLawModel.py	(revision 3db389570c206a21d9ba5706da8726e27ff899b6)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 """ 
-    Provide F(x) = scale/( 1 + (x*L)^2 ) + bkd
-    Lorentz function as a BaseComponent model
+    Provide F(x) = scale* (x)^(-m) + bkd
+    Power law function as a BaseComponent model
 """
 
@@ -13,5 +13,5 @@
         Class that evaluates a Power_Law model.
         
-        F(x) = scale* (x)^(m) + bkd
+        F(x) = scale* (x)^(-m) + bkd
         
         The model has three parameters: 
@@ -32,26 +32,26 @@
         ## Define parameters
         self.params = {}
-        self.params['m']     = 50.0
-        self.params['scale'] = 100.0
-        self.params['bkd']   = 1
+        self.params['m']            = 4.0
+        self.params['scale']        = 1.0
+        self.params['background']   = 0.0
 
         ## Parameter details [units, min, max]
         self.details = {}
-        self.details['m']    = ['', None, None ]
-        self.details['scale'] = ['', None, None]
-        self.details['bkd']   = ['cm^{-1}', None, None]
+        self.details['m']           = ['', None, None ]
+        self.details['scale']       = ['', None, None]
+        self.details['background']  = ['', None, None]
                
     def _PowerLaw(self, x):
         """
-            Evaluate  F(x) = scale* (x)^(m) + bkd
+            Evaluate  F(x) = scale* (x)^(-m) + bkd
            
         """
-        return self.params['scale']*math.pow(x ,self.params['m'])\
-                + self.params['bkd']
+        return self.params['scale']*math.pow(x ,-self.params['m'])\
+                + self.params['background']
        
    
     def run(self, x = 0.0):
         """ Evaluate the model
-            @param x: simple value
+            @param x: input q-value (float or [float, float] as [r, theta])
             @return: (PowerLaw value)
         """
@@ -65,5 +65,5 @@
     def runXY(self, x = 0.0):
         """ Evaluate the model
-            @param x: simple value
+            @param x: input q-value (float or [float, float] as [qx, qy])
             @return: PowerLaw value
         """
Index: sansmodels/src/sans/models/SubComponent.py
===================================================================
--- sansmodels/src/sans/models/SubComponent.py	(revision ae3ce4eaa593202ebf49122e196897c0d45a25b6)
+++ sansmodels/src/sans/models/SubComponent.py	(revision 3db389570c206a21d9ba5706da8726e27ff899b6)
@@ -38,4 +38,12 @@
         return self.operateOn.run(x) - self.other.run(x)
         
+    def runXY(self, x=0):
+        """
+            Evaluate each part of the component and sum the results
+            @param x: input parameter
+            @return: value of the model at x
+        """
+        return self.operateOn.runXY(x) - self.other.runXY(x)
+        
     def setParam(self, name, value):
         """ 
Index: sansmodels/src/sans/models/TeubnerStreyModel.py
===================================================================
--- sansmodels/src/sans/models/TeubnerStreyModel.py	(revision 829eee9c87a25f8870f8613d915daf0cfa4c4d05)
+++ sansmodels/src/sans/models/TeubnerStreyModel.py	(revision 3db389570c206a21d9ba5706da8726e27ff899b6)
@@ -37,5 +37,5 @@
         self.params['c2']     = 5000.0
         self.params['scale']  = 0.1
-        self.params['bkd']    = 0.1
+        self.params['background']    = 0.0
 
         ## Parameter details [units, min, max]
@@ -44,5 +44,5 @@
         self.details['c2']    = ['', None, None ]
         self.details['scale'] = ['', None, None]
-        self.details['bkd']   = ['cm^{-1}', None, None]
+        self.details['background']   = ['', None, None]
     
                
@@ -58,5 +58,5 @@
     def run(self, x = 0.0):
         """ Evaluate the model
-            @param x: simple value
+            @param x: input q-value (float or [float, float] as [r, theta])
             @return: (PowerLaw value)
         """
@@ -71,5 +71,5 @@
     def runXY(self, x = 0.0):
         """ Evaluate the model
-            @param x: simple value
+            @param x: input q-value (float or [float, float] as [qx, qy])
             @return: PowerLaw value
         """
@@ -81,26 +81,16 @@
             return self._TeubnerStrey(x)
         
-    def TeubnerStreyLengths(self):
+    def teubnerStreyLengths(self):
         """
             Calculate the correlation length (L) 
             @return L: the correlation distance 
         """
-        if (self.params['c2'] !=0) and \
-        ((2*math.pow(self.params['scale'],1/2)+self.params['c1'])>= 0):
-            L =  math.pow( 1/2 * math.pow( (self.params['scale']/self.params['c2']), 1/2 )\
+        return  math.pow( 1/2 * math.pow( (self.params['scale']/self.params['c2']), 1/2 )\
                             +(self.params['c1']/(4*self.params['c2'])),-1/2 )
-            return L
-        else:
-            return False
-    def TeubnerStreyDistance(self):
+    def teubnerStreyDistance(self):
         """
             Calculate the quasi-periodic repeat distance (D/(2*pi)) 
             @return D: quasi-periodic repeat distance
         """
-        if (self.params['c2'] !=0) and \
-        ((2*math.pow(self.params['scale'],1/2)-self.params['c1'])>= 0):
-            D =  math.pow( 1/2 * math.pow( (self.params['scale']/self.params['c2']), 1/2 )\
+        return  math.pow( 1/2 * math.pow( (self.params['scale']/self.params['c2']), 1/2 )\
                             -(self.params['c1']/(4*self.params['c2'])),-1/2 )
-            return D
-        else:
-            return False
Index: sansmodels/src/sans/models/UnifiedPowerLaw.py
===================================================================
--- sansmodels/src/sans/models/UnifiedPowerLaw.py	(revision 829eee9c87a25f8870f8613d915daf0cfa4c4d05)
+++ 	(revision )
@@ -1,157 +1,0 @@
-#!/usr/bin/env python
-""" 
-    Provide F(x) = scale/( 1 + (x*L)^2 ) + bkd
-    Lorentz function as a BaseComponent model
-"""
-
-from sans.models.BaseComponent import BaseComponent
-import math
-import matplotlib
-from scipy.special import erf
-class UnifiedPowerLawModel(BaseComponent):
-   
-    """
-        Class that evaluates a Unified Power_Law model.
-    
-        F(x) =  bkd + sum(G[i]*exp(-x**2 *Rg[i]**2 /3)) \
-          + [B[i]( erf(x*Rg[i]/math.sqrt(6)))** (3*p[i])]/x**p[i] )
-        
-        For each level four parameters must be chosen
-        The model has 5 parameters: 
-           Gi  = ?
-           Rgi = Guinier Radius
-           Pi  = power for each level
-           Bi  = ?
-        Four Levels can be used
-            i is each level 
-           
-    """
-   
-    def __init__(self):
-        """ Initialization """
-        
-        # Initialize BaseComponent first, then sphere
-        BaseComponent.__init__(self)
-        
-        ## Name of the model
-        self.name = " UnifiedPowerLaw " 
-        # default Number of levels 
-
-        self.LevelTotal =2
-
-        ## Define parameters
-        self.params = {}
-        
-        for i in xrange(self.LevelTotal):
-            self.params['G'+ str(i+1)]= 0.0
-            self.params['B'+ str(i+1)]= 0.0
-            self.params['Rg'+ str(i+1)]= 0.0
-            self.params['P'+ str(i+1)]= 0.0
-            
-        ## input Variables with default values for two levels
-        
-        self.params['G1']     = 400.0
-        self.params['G2']     = 3.0
-        
-        self.params['B1']     = 5 * math.exp(-6)
-        self.params['B2']     = 0.0006
-        
-        self.params['Rg1']    = 200.0
-        self.params['Rg2']    = 100.0
-        
-        self.params['P1']    = 4.0
-        self.params['P2']    = 2.0
-        
-        self.params['bkd']    = 0.0
-        
-        
-
-        ## Parameter details [units, min, max]
-        self.details = {}
-        self.details['G1']    = ['cm^{-1} sr^{-1}', None, None ]
-        self.details['G2']    = ['cm^{-1} sr^{-1}', None, None ]
-        self.details['B1']    = ['cm^{-1} sr^{-1}', None, None ]
-        self.details['B2']    = ['cm^{-1} sr^{-1}', None, None ]
-        self.details['Rg1']   = ['A', None, None ]
-        self.details['Rg2']   = ['A', None, None ]
-        self.details['P1']    = ['', None, None ]
-        self.details['P2']    = ['', None, None ]
-        self.details['bkd']   = ['cm^{-1} sr^{-1}', None, None]
-
-    def getValue(self, paramType,level):
-        
-        return self.getParam(str(paramType)+str(level))
-    
-    def setValueParam(self,level,Bvalue,Rgvalue,Gvalue,Pvalue):
-        """
-            set value of parameter given a level
-        """
-        self.params['G'+str(level)] = Gvalue
-        self.params['B'+str(level)] = Bvalue
-        self.params['Rg'+str(level)]= Rgvalue
-        self.params['P'+str(level)] = Pvalue
-        # set the number total of level for the sum
-        if self.LevelTotal < level:
-            self.LevelTotal = level
-            
-        # set parameter details
-        self.details['G'+str(level)]   = ['cm^{-1} sr^{-1}', None, None ]
-        self.details['B'+str(level)]   = ['cm^{-1} sr^{-1}', None, None ]
-        self.details['Rg'+str(level)]  = ['A', None, None ]
-        self.details['P'+str(level)]   = ['', None, None ]
- 
-
-    def _Sum(self,x):
-        """
-            Calculate the sum of Gi*exp(-x^(2)*Rgi^(2)/3)
-        """
-        sum =0
-        # the default level is 2 and we are using the default values
-        if (self.LevelTotal <= 2)and (self.LevelTotal > 1):
-            return self.params['G1']*math.exp(-(x**2)* (self.params['Rg1']**2)/3)+\
-                self.params['G2']*math.exp(-(x**2)* (self.params['Rg2']**2)/3)
-        # For level higher than 2 
-        else: 
-            for i in xrange(self.LevelTotal):
-                sum =sum +self.params['G'+str(i+1)]*math.exp(-(x**2)* (self.params['Rg'+str(i+1)]**2)/3)
-            return sum 
-                
- 
-    def _UnifiedPow(self,level,x ):
-        """
-            Calculates the values of the Unified Power Law function
-            @param level: user should enters the level of computation else level =2 
-                will be used
-            @param x: a number
-        """
-       
-        return self.params['bkd']+self._Sum(x)+ (self.params['B'+str(level)]*\
-             math.pow(erf(x * self.params['Rg'+str(level)]/math.sqrt(6))\
-            ,3 * self.params['P'+str(level)]))/math.pow(x,self.params['P'+str(level)])
-       
-    def run(self, level,x = 0.0):
-        """ Evaluate the model
-            @param x: simple value
-            @param level : level of computation
-            @return: (Unified Power law value)
-        """
-        if x.__class__.__name__ == 'list':
-            return self._UnifiedPow(level, x[0]*math.cos(x[1]))*\
-                self.__UnifiedPow(level, x[0]*math.sin(x[1]))
-        elif x.__class__.__name__ == 'tuple':
-            raise ValueError, "Tuples are not allowed as input to BaseComponent models"
-        else:
-            return self._UnifiedPow(level,x)
-   
-    def runXY(self,level, x = 0.0):
-        """ Evaluate the model
-            @param x: simple value
-            @param level : level of computation
-            @return: Unified Power law value
-        """
-        if x.__class__.__name__ == 'list':
-            return self._UnifiedPow(level, x[0])*self._UnifiedPow(level,x[1])
-        elif x.__class__.__name__ == 'tuple':
-            raise ValueError, "Tuples are not allowed as input to BaseComponent models"
-        else:
-            return self._UnifiedPow(level, x)
Index: sansmodels/src/sans/models/prototypes/UnifiedPowerLaw.py
===================================================================
--- sansmodels/src/sans/models/prototypes/UnifiedPowerLaw.py	(revision 3db389570c206a21d9ba5706da8726e27ff899b6)
+++ sansmodels/src/sans/models/prototypes/UnifiedPowerLaw.py	(revision 3db389570c206a21d9ba5706da8726e27ff899b6)
@@ -0,0 +1,159 @@
+#!/usr/bin/env python
+""" 
+    Failed attempt at a Beaucage model.
+"""
+#TODO: Clean this up
+#TODO: Remove setValueParam, which doesn't belong in this class!
+#      It totally breaks the philosophy of this class
+
+from sans.models.BaseComponent import BaseComponent
+import math
+import matplotlib
+from scipy.special import erf
+class UnifiedPowerLawModel(BaseComponent):
+   
+    """
+        Class that evaluates a Unified Power_Law model.
+    
+        F(x) =  bkd + sum(G[i]*exp(-x**2 *Rg[i]**2 /3)) \
+          + [B[i]( erf(x*Rg[i]/math.sqrt(6)))** (3*p[i])]/x**p[i] )
+        
+        For each level four parameters must be chosen
+        The model has 5 parameters: 
+           Gi  = ?
+           Rgi = Guinier Radius
+           Pi  = power for each level
+           Bi  = ?
+        Four Levels can be used
+            i is each level 
+           
+    """
+   
+    def __init__(self):
+        """ Initialization """
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        
+        ## Name of the model
+        self.name = " UnifiedPowerLaw " 
+        # default Number of levels 
+
+        self.LevelTotal =2
+
+        ## Define parameters
+        self.params = {}
+        
+        for i in xrange(self.LevelTotal):
+            self.params['G'+ str(i+1)]= 0.0
+            self.params['B'+ str(i+1)]= 0.0
+            self.params['Rg'+ str(i+1)]= 0.0
+            self.params['P'+ str(i+1)]= 0.0
+            
+        ## input Variables with default values for two levels
+        
+        self.params['G1']     = 400.0
+        self.params['G2']     = 3.0
+        
+        self.params['B1']     = 5 * math.exp(-6)
+        self.params['B2']     = 0.0006
+        
+        self.params['Rg1']    = 200.0
+        self.params['Rg2']    = 100.0
+        
+        self.params['P1']    = 4.0
+        self.params['P2']    = 2.0
+        
+        self.params['bkd']    = 0.0
+        
+        
+
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['G1']    = ['cm^{-1} sr^{-1}', None, None ]
+        self.details['G2']    = ['cm^{-1} sr^{-1}', None, None ]
+        self.details['B1']    = ['cm^{-1} sr^{-1}', None, None ]
+        self.details['B2']    = ['cm^{-1} sr^{-1}', None, None ]
+        self.details['Rg1']   = ['A', None, None ]
+        self.details['Rg2']   = ['A', None, None ]
+        self.details['P1']    = ['', None, None ]
+        self.details['P2']    = ['', None, None ]
+        self.details['bkd']   = ['cm^{-1} sr^{-1}', None, None]
+
+    def getValue(self, paramType,level):
+        
+        return self.getParam(str(paramType)+str(level))
+    
+    def setValueParam(self,level,Bvalue,Rgvalue,Gvalue,Pvalue):
+        """
+            set value of parameter given a level
+        """
+        self.params['G'+str(level)] = Gvalue
+        self.params['B'+str(level)] = Bvalue
+        self.params['Rg'+str(level)]= Rgvalue
+        self.params['P'+str(level)] = Pvalue
+        # set the number total of level for the sum
+        if self.LevelTotal < level:
+            self.LevelTotal = level
+            
+        # set parameter details
+        self.details['G'+str(level)]   = ['cm^{-1} sr^{-1}', None, None ]
+        self.details['B'+str(level)]   = ['cm^{-1} sr^{-1}', None, None ]
+        self.details['Rg'+str(level)]  = ['A', None, None ]
+        self.details['P'+str(level)]   = ['', None, None ]
+ 
+
+    def _Sum(self,x):
+        """
+            Calculate the sum of Gi*exp(-x^(2)*Rgi^(2)/3)
+        """
+        sum =0
+        # the default level is 2 and we are using the default values
+        if (self.LevelTotal <= 2)and (self.LevelTotal > 1):
+            return self.params['G1']*math.exp(-(x**2)* (self.params['Rg1']**2)/3)+\
+                self.params['G2']*math.exp(-(x**2)* (self.params['Rg2']**2)/3)
+        # For level higher than 2 
+        else: 
+            for i in xrange(self.LevelTotal):
+                sum =sum +self.params['G'+str(i+1)]*math.exp(-(x**2)* (self.params['Rg'+str(i+1)]**2)/3)
+            return sum 
+                
+ 
+    def _UnifiedPow(self,level,x ):
+        """
+            Calculates the values of the Unified Power Law function
+            @param level: user should enters the level of computation else level =2 
+                will be used
+            @param x: a number
+        """
+       
+        return self.params['bkd']+self._Sum(x)+ (self.params['B'+str(level)]*\
+             math.pow(erf(x * self.params['Rg'+str(level)]/math.sqrt(6))\
+            ,3 * self.params['P'+str(level)]))/math.pow(x,self.params['P'+str(level)])
+       
+    def run(self, level,x = 0.0):
+        """ Evaluate the model
+            @param x: simple value
+            @param level : level of computation
+            @return: (Unified Power law value)
+        """
+        if x.__class__.__name__ == 'list':
+            return self._UnifiedPow(level, x[0]*math.cos(x[1]))*\
+                self.__UnifiedPow(level, x[0]*math.sin(x[1]))
+        elif x.__class__.__name__ == 'tuple':
+            raise ValueError, "Tuples are not allowed as input to BaseComponent models"
+        else:
+            return self._UnifiedPow(level,x)
+   
+    def runXY(self,level, x = 0.0):
+        """ Evaluate the model
+            @param x: simple value
+            @param level : level of computation
+            @return: Unified Power law value
+        """
+        if x.__class__.__name__ == 'list':
+            return self._UnifiedPow(level, x[0])*self._UnifiedPow(level,x[1])
+        elif x.__class__.__name__ == 'tuple':
+            raise ValueError, "Tuples are not allowed as input to BaseComponent models"
+        else:
+            return self._UnifiedPow(level, x)
