anchor.diff:          let paddedRawData = 
               let rnd = System.Random()    
               data
  -            |> Seq.map (padArray2DWithRandom rnd 40)
  +            |> Seq.map (padArray2DWithRandom rnd borderpadding)
               |> Array.ofSeq
           paddedRawData
   
   
  -    let inline C3DWT (marr: Marr.MarrWavelet) (frame:'a[,]) =   
  -        let resolutionPixelfst = (Array2D.length1 frame) - 40 * 2
  -        let resolutionPixelsnd = (Array2D.length2 frame) - 40 * 2
  -        let offset = marr.PadAreaRadius
  -        let paddingoffset = 40
  -        let (CWTArray2D0: float[,]) = Array2D.zeroCreate (Array2D.length2 frame) (Array2D.length1 frame)
  -        for x = paddingoffset to (paddingoffset + (resolutionPixelsnd-1)) do
  -            for y = paddingoffset to (paddingoffset + (resolutionPixelfst-1)) do
  -                CWTArray2D0.[x,y] <-
  -                    let rec loop acc' a b =
  -                        if a <= 2 * offset then
  -                            if b <= 2 * offset then
  -                                let acc = acc' + ((marr.Values).[a,b] * (frame.[(y+(a-offset)),(x+(b-offset))] |> float))
  -                                loop acc a (b + 1)
  -                            else
  -                                loop acc' (a + 1) 0
  -                        else acc'
  -                    loop 0. 0 0
  -        let deletePaddingArea =
  -            let arrayWithoutPaddingoffset = Array2D.zeroCreate ((Array2D.length1 CWTArray2D0)-(2*paddingoffset)) ((Array2D.length2 CWTArray2D0)-(2*paddingoffset))
  -            for i=paddingoffset to (Array2D.length1 CWTArray2D0)-(paddingoffset+1) do
  -                for j=paddingoffset to (Array2D.length2 CWTArray2D0)-(paddingoffset+1) do
  -                    arrayWithoutPaddingoffset.[(i-paddingoffset),(j-paddingoffset)] <- CWTArray2D0.[i,j]
  -            arrayWithoutPaddingoffset
  -        deletePaddingArea 
  -
  -    ///gets Marr, a framenumber, an offset and the number of pixels to look at in the surrounding, and gives [,] of localMaxima
  +    //let inline C3DWT (marr: Marr.MarrWavelet) (frame:'a[,]) =   
  +    //    let resolutionPixelfst = (Array2D.length1 frame) - 40 * 2
  +    //    let resolutionPixelsnd = (Array2D.length2 frame) - 40 * 2
  +    //    let offset = marr.PadAreaRadius
  +    //    let paddingoffset = 40
  +    //    let (CWTArray2D0: float[,]) = Array2D.zeroCreate (Array2D.length2 frame) (Array2D.length1 frame)
  +    //    for x = paddingoffset to (paddingoffset + (resolutionPixelsnd-1)) do
  +    //        for y = paddingoffset to (paddingoffset + (resolutionPixelfst-1)) do
  +    //            CWTArray2D0.[x,y] <-
  +    //                let rec loop acc' a b =
  +    //                    if a <= 2 * offset then
  +    //                        if b <= 2 * offset then
  +    //                            let acc = acc' + ((marr.Values).[a,b] * (frame.[(y+(a-offset)),(x+(b-offset))] |> float))
  +    //                            loop acc a (b + 1)
  +    //                        else
  +    //                            loop acc' (a + 1) 0
  +    //                    else acc'
  +    //                loop 0. 0 0
  +    //    let deletePaddingArea =
  +    //        let arrayWithoutPaddingoffset = Array2D.zeroCreate ((Array2D.length1 CWTArray2D0)-(2*paddingoffset)) ((Array2D.length2 CWTArray2D0)-(2*paddingoffset))
  +    //        for i=paddingoffset to (Array2D.length1 CWTArray2D0)-(paddingoffset+1) do
  +    //            for j=paddingoffset to (Array2D.length2 CWTArray2D0)-(paddingoffset+1) do
  +    //                arrayWithoutPaddingoffset.[(i-paddingoffset),(j-paddingoffset)] <- CWTArray2D0.[i,j]
  +    //        arrayWithoutPaddingoffset
  +    //    deletePaddingArea 
  +    
  +    ///computes a continuous wavelet transform on discrete data (default borderpadding=40)
  +    let inline transform3D (wavelet: Marr.MarrWavelet)  (borderpadding: int) (data: 'a [,]) =
  +            let resolutionPixelfst = (Array2D.length1 data) - borderpadding * 2
  +            let resolutionPixelsnd = (Array2D.length2 data) - borderpadding * 2
  +            let offset = wavelet.PadAreaRadius
  +            Array2D.init resolutionPixelfst resolutionPixelsnd (fun i j -> 
  +                let indexX = i + borderpadding
  +                let indexY = j + borderpadding
  +                let rec loop acc' a b =
  +                    if a <= 2 * offset then
  +                        if b <= 2 * offset then
  +                            let acc = acc' + ((wavelet.Values).[a,b]) * float (data.[(indexX+(a-offset)),(indexY+(b-offset))])
  +                            loop acc a (b + 1)
  +                        else
  +                            loop acc' (a + 1) 0
  +                    else 
  +                        let energycorrection = acc' / (sqrt (Math.Abs wavelet.Scale))
  +                        energycorrection
  +                loop 0. 0 0
  +                )
  +
  +    [<Obsolete("Do not use. Switch to transform3D instead.")>]
  +    let inline C3DWT (marr: Marr.MarrWavelet) (frame:'a[,]) = transform3D marr 40 frame 
  +
  +    ///gets a Marr wavelet and a raw frame to isolate local maxima
  +    [<Obsolete("Do not use. Switch to isolateLocalMaxima instead.")>]
       let inline findLocalMaxima (marr:Marr.MarrWavelet) frame =   
           ///gets single 2D Array with only Maxima in it and gives coordinates of local maxima
           let allmaximaArray (arr:float[,]) =
               let rec loop acc i j =
                   if i < (Array2D.length1 arr)-1 then
                       if j < (Array2D.length2 arr)-1  then 
  -                        if (arr.[i,j]) > 0. then loop ((float i, float j)::acc) i (j+1) 
  +                        if (arr.[i,j]) > 0. then 
  +                            //loop ((float i, float j)::acc) i (j+1) 
  +                            loop ((createLocalMaxima -1 (float i) (float j) arr.[i,j])::acc) i (j+1) 
                           else loop acc i (j+1)    
                       else loop acc (i+1) 0
                   else acc
               loop [] 0 0 
           let numberofsurpix = marr.LMdistance
  -        let (cWTPercArray: float [,]) = C3DWT marr frame  
  -        let arrayOfMaxima = Array2D.zeroCreate ((Array2D.length1 cWTPercArray)) ((Array2D.length2 cWTPercArray))
  +        let cWTPercArray: float [,] = transform3D marr 40 frame //C3DWT marr frame  
  +        let arrayOfMaxima = Array2D.zeroCreate (Array2D.length1 cWTPercArray) (Array2D.length2 cWTPercArray)
           let checkListsForContinuousDecline b c numberofsurpix =      
               let createSurroundingPixelLists b c numberofsurpix =
                   let rec loop i accN accS accW accE accNW accSW accNE accSE =
                       let imod = (i |> float) * 0.7071 |> floor |> int
                       if i <= numberofsurpix then 
  -                        loop (i+1) (cWTPercArray.[b+i   ,c     ]::accN )
  +                         loop (i+1) (cWTPercArray.[b+i   ,c     ]::accN )
                                       (cWTPercArray.[b-i   ,c     ]::accS )
                                       (cWTPercArray.[b     ,c-i   ]::accW )
                                       (cWTPercArray.[b     ,c+i   ]::accE )
  
positive.code:                 FSharp.Stats.ML.Unsupervised.DbScan.compute FSharp.Stats.ML.DistanceMetrics.euclideanNaNSquared minPts squaredEPs filteredPoints                
              let clusterlist=                 
                  clusterresult.Clusterlist 
                      |> Seq.map (fun x -> x 
                                              |> Seq.map (fun x -> x.[0],x.[1])
                                              |> centroidOfTupelList
                                  ) 
              clusterlist,clusterresult
          clustercentroids
  
      //gives final centroids and clusterresult
      let inline isolateCentroids2 eps minPts (marrList:Marr.MarrWavelet list) followingFrames zEqualityDistance (data:seq<'a[,]>)=  
          ///calculates the centroid of a given TupelList. This function is needed in the DBSCAN
          let centroidOfTupelList (tList: seq<float*float>) =
              let length = tList |> Seq.length
  
negative.code: 
          let filteredPoints = 
              marrList
              |> List.map (fun x -> zEqualityFilter followingFrames zEqualityDistance (isolateLocalMaxima x data))//(collectAllFrameInformation x data))
              |> Array.concat     
              |> Array.distinct
              |> Array.map (fun x -> [|x.Y;x.X|])
  