RC4 has proved itself as robust enough and is trusted by many organizations. A number of researchers claimed that though this stream cipher is simple, fast, easy to implement, it has some weakness and bias in its internal states. Some researchers argued that the swap function of RC4 in key-scheduling algorithm (KSA) and pseudo-random generation algorithm (PRGA) is the main reason of weakness. The authors of this paper eliminated the KSA and used a mathematical process to generate the internal state array(s) of RC4. Also, the PRGA has been modified to handle two S-boxes to generate two keystream bytes in one loop. Both the algorithms, original and modified, are tested with the NIST Statistical Test Suite. It has been found that the modified RC4 is giving a better randomness in the ciphertexts, hence giving a better security. © 2015, Springer India.