implement mrf optimize