Removed lurking debug print statements, moved diagonal calculation into the main conditional while loop, and revamped file handling so that it does not delete the top most parent directory. Finaloutput now outputs into main output folder.