C++ DFT modified