         inverseIndexSize = ceil(((float) (mNumberOfHashFunctions * mBlockSize) / (float) mShingleSize));        
     }
     
-    // if (pBloomierFilter) {
-    //     mInverseIndexStorage = new InverseIndexStorageBloomierFilter(inverseIndexSize, mMaxBinSize, maximalFeatures);
-    // } else {
-    //     mInverseIndexStorage = new InverseIndexStorageUnorderedMap(inverseIndexSize, mMaxBinSize);
-    // }
-    // mRemoveValueWithLeastSigificantBit = pRemoveValueWithLeastSigificantBit;
-        // std::cout << __LINE__ << std::endl;
     
 }
  
 InverseIndexCuda::~InverseIndexCuda() {
-    delete mSignatureStorage;
-    delete mHash;
-    delete mInverseIndexStorage;
+   cudaFree(mDev_FeatureList);
+   cudaFree(mDev_ComputedSignaturesPerInstance);
+   cudaFree(mDev_SizeOfInstanceList);
+  
 }
 
 distributionInverseIndex* InverseIndexCuda::getDistribution() {

                    size_t pMaxBinSize, size_t pMinimalBlocksInCommon,
                    size_t pExcessFactor, size_t pMaximalNumberOfHashCollisions, size_t pBloomierFilter,
                    int pPruneInverseIndex, float pPruneInverseIndexAfterInstance, int pRemoveHashFunctionWithLessEntriesAs,
                    size_t pHashAlgorithm, size_t pBlockSize, size_t pShingle, size_t pRemoveValueWithLeastSigificantBit) {   
        // std::cout << __LINE__ << std::endl;
                        
    mNumberOfHashFunctions = pNumberOfHashFunctions;

    mPruneInverseIndexAfterInstance = pPruneInverseIndexAfterInstance;
    mRemoveHashFunctionWithLessEntriesAs = pRemoveHashFunctionWithLessEntriesAs;
    mHashAlgorithm = pHashAlgorithm;
    mBlockSize = pBlockSize;
    mShingle = pShingle;
    size_t inverseIndexSize;
    if (mShingle == 0) {
        if (mBlockSize == 0) {
