fixed trim() when reading words from file