In this work, an improved IMplicit Pressure and Explicit Saturation (IMPES) scheme is proposed to solve the coupled partial differential equations to simulate the three-phase flows in subsurface porous media. This scheme is the first IMPES algorithm for the three-phase flow problem that is locally mass conservative for all phases. The key technique of this novel scheme relies on a new formulation of the discrete pressure equation. Different from the conventional scheme, the discrete pressure equation in this work is obtained by adding together the discrete conservation equations of all phases, thus ensuring the consistency of the pressure equation with the three saturation equations at the discrete level. This consistency is important, but unfortunately it is not satisfied in the conventional IMPES schemes. In this paper, we address and fix an undesired and well-known consequence of this inconsistency in the conventional IMPES in that the computed saturations are conservative only for two phases in three-phase flows, but not for all three phases. Compared with the standard IMPES scheme, the improved IMPES scheme has the following advantages: firstly, the mass conservation of all the phases is preserved both locally and globally; secondly, it is unbiased toward all phases, i.e., no reference phases need to be chosen; thirdly, the upwind scheme is applied to the saturation of all phases instead of only the referenced phases; fourthly, numerical stability is greatly improved because of phase-wise conservation and unbiased treatment. Numerical experiments are also carried out to demonstrate the strength of the improved IMPES scheme.