generalize WalshExpansion, Implemente two versions of smoothExpansion