   long minLengthOwnLimbs = LLONG_MAX;
   for(int i = 0; i < nr_rows; ++i)
     for(int j = 0; j < nr_cols; ++j) {
-      generateLongsFromGMP(a[j * nr_rows + i], tmpX[j * nr_rows + i], lengthOwnLimbs[j * nr_rows + i], maxBits, maxExp); 
+      generateLongsFromGMP(a[j * nr_rows + i], tmpX[j * nr_rows + i], lengthOwnLimbs[j * nr_rows + i], ownLimbSize, maxExp); 
       if (minLengthOwnLimbs > lengthOwnLimbs[j * nr_rows + i]) minLengthOwnLimbs = lengthOwnLimbs[j * nr_rows + i];
     }
 

  std::cout << tmp << std::endl;
}

void generateLongsFromGMP(const mpf_class a, long long *&x, int &sizeOfArray, const int maxBits, const int maxExp) {
  int size = a.get_mpf_t()->_mp_size; 
  int realExp = a.get_mpf_t()->_mp_exp;
  int padding = (maxExp - realExp) / maxBits;
  int paddR = (maxExp - realExp) % maxBits;
  
  // Assert that the padding will work and that the maximumBitSize is given appropraitely 
  assert(realExp <= maxExp);
  assert(maxBits <= INT64L);

  // Find size of needed 64-bit variable array with padding and allocate it in memory
  sizeOfArray = (INT64L * size + (maxExp - realExp)) / maxBits;
  
  if ((INT64L * size + (maxExp - realExp)) % maxBits != 0) sizeOfArray += 1; 
  x = (long long *)malloc(sizeOfArray * sizeof(long long));
  
  // Add padding

// This can be WAAAAAAY more optimized 
// Right now I think it takes time d^2 N^2. 
// It should take time N^2

// TODO: Add initialization functions for mpf_t's
// TODO: Maybe do bitwise operations and carry's by hand?
void addToGMP(mpf_class &a, const long long toAdd, const int bitToAdd) {
  mpf_t tmpDiv;
  mpf_init(tmpDiv);
