implemented the DFT method.