Thanks a lot everyone for suggestions. On my slow machine (667 MHz), inefficient programs run even slower, and when I expand the program to calculate 9-digit numbers, there is almost a 2-minute difference! Thanks again. Best, Kye