Thank you bluegray. after implementing your code my program works perfectly now. my error was using postfix increment rather than the prefix. they're so confusing. I don't have a clue how to use them in loops. but looks like i'll have to go learn them now. anywayz, thank you again for bailing out a noob, saved me a ton of time not doing trial and error.