diff --git a/miscprob.cc b/miscprob.cc
index a57c39779aa960ef2fc5196812914aecb13dd23b..e19ffaa1c61da46e2054f082ffcafb546a87aa42 100644
--- a/miscprob.cc
+++ b/miscprob.cc
@@ -25,10 +25,10 @@ ReturnMatrix unifrnd(const int dim1, const int dim2, const float start, const fl
   Matrix res(dim1,tdim);
   for (int mc=1; mc<=res.Ncols(); mc++) {
     for (int mr=1; mr<=res.Nrows(); mr++) {
-      //tmpD = (rand()+1)/double(RAND_MAX+2.0);
-      //res(mr,mc)=(tmpD)*(end-start)+start;
-      drand(&tmpD);
-      res(mr,mc)=(tmpD-1)*(end-start)+start;
+      tmpD = (rand()+1)/double(RAND_MAX+2.0);
+      res(mr,mc)=(tmpD)*(end-start)+start;
+      //drand(&tmpD);
+      //res(mr,mc)=(tmpD-1)*(end-start)+start;
     }
   }
 
@@ -44,10 +44,10 @@ ReturnMatrix normrnd(const int dim1, const int dim2, const float mu, const float
   Matrix res(dim1,tdim);
   for (int mc=1; mc<=res.Ncols(); mc++) {
     for (int mr=1; mr<=res.Nrows(); mr++) {
-      //tmpD = (rand()+1)/double(RAND_MAX+2.0);
-      //res(mr,mc)=ndtri(tmpD)*sigma+mu ;
-      drand(&tmpD);
-      res(mr,mc)=ndtri(tmpD-1)*sigma+mu ;
+      tmpD = (rand()+1)/double(RAND_MAX+2.0);
+      res(mr,mc)=ndtri(tmpD)*sigma+mu ;
+      //drand(&tmpD);
+      //res(mr,mc)=ndtri(tmpD-1)*sigma+mu ;
     }
   }