diff --git a/xfibres.cc b/xfibres.cc
index b7784e48486ab470cc09d5f2390f091b8530c14c..57c1fa57d028b5a8f4fa29b277de8ec3cbe13dc8 100644
--- a/xfibres.cc
+++ b/xfibres.cc
@@ -202,7 +202,7 @@ class xfibresVoxelManager{
   Multifibre m_multifibre;
  public:
   xfibresVoxelManager(const ColumnVector& data,const ColumnVector& alpha, 
-		      const ColumnVector& beta, const Matrix& b, const Matrix& Amat,
+		      const ColumnVector& beta, const Matrix& b,
 		      Samples& samples,int voxelnumber):
     opts(xfibresOptions::getInstance()), 
     m_samples(samples),m_voxelnumber(voxelnumber),m_data(data), 
@@ -327,7 +327,7 @@ int main(int argc, char *argv[])
     
     
     Matrix datam, bvals,bvecs;
-    volume<char> mask;
+    volume<float> mask;
     bvals=read_ascii_matrix(opts.bvalsfile.value());
     bvecs=read_ascii_matrix(opts.bvecsfile.value());
     
@@ -338,40 +338,22 @@ int main(int argc, char *argv[])
       datam=data.matrix(mask);  
     }
     
-    Samples samples(datam.Ncols());
-    
-    
     
-    //if(opts.debuglevel.value()==1)
-    //Tracer_Plus::setrunningstackon();
-    
-    //if(opts.timingon.value())
-    //Tracer_Plus::settimingon();
+    Matrix Amat;
+    ColumnVector alpha, beta;
+    Amat=form_Amat(bvecs,bvals);
+    cart2sph(bvecs,alpha,beta);
+    Samples samples(datam.Ncols());
     
-    // read data
-
-    //VolumeSeries data;
-    //data.read(opts.datafile.value());   
-    // data.writeAsFloat(LogSingleton::getInstance().appendDir("data"));
-//     cout<<"done"<<endl;
-//     return 0;
-    //int ntpts = data.tsize();
-    //Matrix bvecs = read_ascii_matrix(opts.bvecsfile.value());
-    //Matrix bvals = read_ascii_matrix(opts.bvalsfile.value());
-    // mask:
-    //Volume mask;
-    ///mask.read(opts.maskfile.value());
-    //mask.threshold(1e-16);
     
-    // threshold using mask:
-    //data.setPreThresholdPositions(mask.getPreThresholdPositions());
-    //data.thresholdSeries();
-    ColumnVector A,B,C;
+    for(int vox=1;vox<=datam.Ncols();vox++){
+      xfibresVoxelManager  vm(datam.Column(vox),alpha,beta,bvals,samples,vox);
+      vm.initialise(Amat);
+      vm.runmcmc();
+    }
     
-    Matrix b,Amat;
-    int n;
+    samples.save();
 
-    Multifibre(A,B,C,b,n);
   }
   catch(Exception& e) 
     {
diff --git a/xfibresoptions.h b/xfibresoptions.h
index 57ec3e77ba9b946f09e213670e11d598e3dda75c..a8a4aa65fe07874d432fea9bfb53611256511a9e 100644
--- a/xfibresoptions.h
+++ b/xfibresoptions.h
@@ -41,7 +41,7 @@ class xfibresOptions {
   Option<int> nburn;
   Option<int> sampleevery;
   Option<int> updateproposalevery;
-  Option<float> seed;
+  Option<int> seed;
   void parse_command_line(int argc, char** argv,  Log& logger);
   
  private:
@@ -103,7 +103,7 @@ class xfibresOptions {
   updateproposalevery(string("--upe,--updateproposalevery"),40,
 	string("Num of jumps for each update to the proposal density std (MCMC) (default is 40)"),
 	false,requires_argument),
-  seed(string("--seed"),0.76986654,string("seed for pseudo random number generator"),
+  seed(string("--seed"),8665904,string("seed for pseudo random number generator"),
        false,requires_argument),
    options("xfibres", "xfibres -k <filename>\n xfibres --verbose\n")
    {