changed calculation of wordcount