Finished cleaning up the code for the testing scripts