parallelized the MRI code