DFT. Not working properly