finish mRF.c, fix error, add code comments