DFT spped up and bug fix for phase correction