Improve the performance of calculating M, M^{-1} using FS