   long size = THCudaTensor_nElement(self);
   thrust::device_ptr<float> self_data(THCudaTensor_data(self));
   
-  thrust::sequence(self_data, self_data+size, step+=size);
+  thrust::sequence(self_data, self_data+size, step); step+=size;
   thrust::transform(self_data, self_data+size, self_data, exponential_functor(lambda));
 
   THCudaTensor_freeCopyTo(self, self_);

  long size = THCudaTensor_nElement(self);
  thrust::device_ptr<float> self_data(THCudaTensor_data(self));

  thrust::sequence(self_data, self_data+size, step+=size);
  thrust::transform(self_data, self_data+size, self_data, random1_functor(b));

  THCudaTensor_freeCopyTo(self, self_);

  long size = THCudaTensor_nElement(self);
  thrust::device_ptr<float> self_data(THCudaTensor_data(self));

  thrust::sequence(self_data, self_data+size, step); step+=size;
  thrust::transform(self_data, self_data+size, self_data, normal_functor(mean,stdv));

  THCudaTensor_freeCopyTo(self, self_);
