             guard fmtDesc != nil else { return }
             channelCount = Int(fmtDesc.memory.mChannelsPerFrame)
         }
-        _ = sizeof(Int16)
+
         var sampleMax = noiseFloor
-        var tally: CGFloat = 0.0
-        var tallyCount = 0
-        var samplesPerPixel = slice.count / targetSamples
+        var samplesPerPixel = channelCount * slice.count / targetSamples
         if samplesPerPixel < 1 {
             samplesPerPixel = 1
         }

        }
    }

    // TODO: switch to a synchronous function that paints onto a given context? (for issue #2)
    func plotLogGraph(samples: [CGFloat], maximumValue max: CGFloat, zeroValue min: CGFloat, imageHeight: CGFloat, done: (image: UIImage, selectedImage: UIImage)->Void) {
        let imageSize = CGSizeMake(CGFloat(samples.count), imageHeight)

            scaledProgressWidth = CGFloat(progressSamples - zoomSamples.startIndex) / CGFloat(zoomSamples.count)
        }
        let childFrame = CGRectMake(frame.size.width * scaledX, 0, frame.size.width * scaledWidth, frame.size.height)
        image.frame = childFrame
        highlightedImage.frame = childFrame
        clipping.frame = CGRectMake(0, 0, self.frame.size.width * scaledProgressWidth, self.frame.size.height)
