Code to run simulation study