working MPI code to extract MR and MI
extended last commit a little: now both M and B get separate R and I outputs