tweaked muti.m to avoid some bugs.