diff --git a/truelevel.cabal b/truelevel.cabal
--- a/truelevel.cabal
+++ b/truelevel.cabal
@@ -2,7 +2,7 @@
 Build-Type: Simple
 Description: An audio file compressor / limiter.  This
              program will adjust the dynamic range of a WAVE file.
-Version: 0.1.1
+Version: 0.1.2
 License: BSD3
 License-File: COPYING
 Copyright: Copyright (C) 2006-2008 Bart Massey
diff --git a/truelevel.hs b/truelevel.hs
--- a/truelevel.hs
+++ b/truelevel.hs
@@ -35,7 +35,15 @@
 
 --- Estimate peak amplitude using rms power
 rms :: [Double] -> Double
-rms s = 2 * sqrt (2 * sum (map (\x -> x * x) s) / fromIntegral (length s))
+rms s = 2 * sqrt (2 * avg (map (\x -> x * x) s))
+
+--- Tile variant for peak amplitude
+tile :: Int -> Int -> [a] -> [[a]]
+tile _ _ [] = []
+tile n o s =
+    let cur = take n s
+        rest = drop (n - o) s in
+    cur : (tile n o rest)
 
 --- Estimate peak amplitude as twice highest absolute peak
 --- of low-pass
