implement invertible mpm, need debugging