modified snippet that record the count of 
negative words