Updated word count code