maria's wavelet code