small change: put Dinitial and Dfinal lines of code near beginning, so first LoadMode reflects this