Added definition of treatments and modified definition of factors to work for multiple study files