These dogs are smarter than we think