Added implementation to extract words from file.
Fixed word parsing to meet requirements.