Cleared the EOF issues. What I found was that the EOF cannot detected by the InputStream classes (including the BufferedReader of course. This is why it does not throw an error). Instead, very traditionally, I used the if-catch error. But this may cause a problem beacuse brank line would be null and skip the calculation... hmmm let's thinking about using the Scanner methods.)