fixed indexing error with wavelets