Java Version of Word Counter program