...read somewhere that the only thing that distinguishes human animals from other animals is purposeful planned action. Now, after having had my dogs a few years, I believe this is not true...some animals are able to purposefully think ahead and act on a plan.
Looks like your dog was one of them!