Whenever we come home, we immediately notice how our dogs’ tails shoot right up and wag like a tornado. It clearly shows they’re excited to see us, but a new study explains there might actually be more to a dog’s wagging tail than we thought.

Lynn Buzhardt, DVM, a veterinary consultant for VCA Animal Hospitals, explains dogs often wag their tails if they feel threatened, curious, anxious, insecure, interested or friendly. But how can we tell their exact emotion? She says it depends on three factors: wag position, wag speed, and context.

The Department of Veterinary Medicine at University of Bari, Italy conducted a study on canine body language in 2013 and found that the position of a dog’ tail wag corresponds to the left and right hemispheres of its brain. If your dog’s tail wags more to the right (a strong right-sided wag), it reflects positive emotions, but if it wags more to the left (a strong left-sided wag), it reflects negative ones. If you see your dog’s tail up, it means it is establishing dominance and assertion, but if it’s down, it means it’ establishing submission.

When it comes to the speed of their tail wag, certified dog trainer Cesar Millan said the faster the wag, the higher level of positive emotion, but if it’s wagging less, it might be more of a negative emotion.

It is also important to note that dogs do not wag their tails unless they are around other dogs or humans. “Pups aren’t born knowing what a wagging tail means any more than a newborn baby understands words,” Dr. Buzhardt explains to POPSUGAR in an interview.

Dogs’ tail wagging also differ from different breeds based from their temperaments. “It is so important for people to realize that a wagging tail does not equal a dog that is friendly or wants to be petted,” Dr. E’Lise Christensen says. “It can, but you are much better off looking at the entire dog. If there are stiffened muscles, dilated pupils, tense facial muscles, or ears pinned forward or back, these are signs that you should back off.”

Dr. Massimo Orioles, a veterinary surgeon added that in the same way a tail isn’t always a reliable indicator of happiness, growling isn’t always a reliable indicator of aggression. “Dogs can growl when playing, when frustrated, when experiencing pleasure,” he said.