Reorganized some of the DeepScan algorithm.