fixed the wordcount function
added new test case to wordcount