Improved word definition, added output file