DFT version working pretty well...needs testing