modRSW code from MO visit