We give an efficient implementation of the modified minimal polynomial extrapolation (MMPE) method for solving linear and nonlinear systems. We will show how to choose the auxiliary vectors in the MMPE method such that the resulting approximations are always defined. This new implementation, which is based on an LU factorization with a pivoting strategy, is inexpensive both in time and storage as compared with other extrapolation methods.