Fix error in mcsolve

-Revert to old code with for-loop to get rid of error