modified wordcount script