refactoring script to account for the bug. adding in a new function to make a unique xdf for each test. still need to apply it to the main calculation function. the new function works.