And for after you've fixed that, maybe you should put in checks for invalid code also. If I ask for the 10th character from the word 'brown', your code will throw an exception again. Also, when you're getting an exception, please post the complete stacktrace here so that it's easier to see what's going on. Don't paraphrase your errors (or your ...