Implementation and test cases for wc tool