If you’ve ever adopted a puppy, you probably know how frustrating it can be to teach your new family member the basic tenets of common decency, like not to pee on the carpet or tear up a whole roll of toilet paper.

In other areas, though, pups are rather impressive learners, capable of mimicking some human behaviors. In fact, for some tasks, they learn just as effectively from watching people as they do from watching other dogs, including their own mothers, a new study in Nature revealed.

Researchers from Hungary and the UK took 48 young puppies of various breeds and studied the conditions under which they can be taught to open a puzzle box containing food. The experiment revealed that the puppies were able to learn how to open the box regardless of whether the task was first demonstrated by a person, their mother, or an unfamiliar dog. In other words, not only are puppies capable of social learning, but they're able to learn tasks from humans they don't know—in this case, the experimenter.

However, researchers were surprised to learn that the puppies were more likely to learn how to open the box by watching an unfamiliar dog than by watching their own mothers. That may be because puppies spend more time looking at—and thus, learning from—an unfamiliar dog that intrigues them. This differs from other species such as kittens, which “learn to press a lever for food more rapidly from their mother than from an unfamiliar adult,” the study notes.

In addition, the puppies were able to perform the task again after a one-hour break, indicating that they had retained some memory of the learning experience.

The ability of dogs to learn from humans has been recorded in previous research. A 2015 study revealed that dogs learn better by demonstration (or the “do as I do” method) than training techniques that involve a system of punishments and rewards. The "do as I do" approach probably isn't the most practical method of teaching your pup to do its business outside, but if you already have an adult dog at home, your new puppy can follow the older dog's lead and learn by example.