adjusted script to place one word per line