RSA is a strong public-key cryptosystem, which is generally used for authentication protocols. Most proposed implementations of RSA system are based on Montgomery modular algorithm. And thus the optimization of this algorithm is consequently very important. This paper improves the original algorithm with no increase of any computational cost by avoiding the final comparison and makes it more suitable for implementations both in software and hardware. Unlike previous works, our algorithm just omits the final comparison but subtraction.