On line 44 you said line = br.readLine();
but that shouldn't be inside of that if statement. You want to read in the next line when you're done looking at the previous line; so you should call br.readLine() inside of your while loop but after the for loop exits. You should also use print statements to debug ..
pinsickle commented: very helpful +1