cprrected the code that generates the DOG