script to instrument MRS, but need to fix shut down bug