update read me. refactoring code into MAlgo.