The flow of two or more immiscible fluids in porous media is ubiquitous particularly in oil industry. This includes secondary and tertiary oil recovery, CO2 sequestration, etc. Accurate predictions of the development of these processes are important in estimating the benefits, e.g., in the form of increased oil extraction, when using certain technology. However, this accurate prediction depends to a large extent on two things; the first is related to our ability to correctly characterize the reservoir with all its complexities and the second depends on our ability to develop robust techniques that solve the governing equations efficiently and accurately. In this work, we introduce a new robust and efficient numerical technique to solving the governing conservation laws which govern the movement of two immiscible fluids in the subsurface. This work will be applied to the problem of CO2 sequestration in deep saline aquifer; however, it can also be extended to incorporate more cases. The traditional solution algorithms to this problem are based on discretizing the governing laws on a generic cell and then proceed to the other cells within loops. Therefore, it is expected that, calling and iterating these loops several times can take significant amount of CPU time. Furthermore, if this process is done using programming languages which require repeated interpretation each time a loop is called like Matlab, Python or the like, extremely longer time is expected particularly for larger systems. In this new algorithm, the solution is done for all the nodes at once and not within loops. The solution methodology involves manipulating all the variables as column vectors. Then using shifting matrices, these vectors are sifted in such a way that subtracting relevant vectors produces the corresponding difference algorithm. It has been found that this technique significantly reduces the amount of CPU times compared with traditional technique implemented within the framework of Matlab.