Changed the wavelet algorithm altogether. Using D4 for filtering now.