Refactored for readability/consistency
upgraded DWD wavelet to handle n dimensions
Removed debug output