everyone in the house. However, the thief has been seen by Morgiana who, loyal to her master, foils the thief's plan by marking all the houses in the neighborhood similarly. When the 40 thieves return that night, they cannot identify the correct house, and their leader kills the unsuccessful thief in a furious rage. The next day, another thief revisits Baba Mustafa and tries again. Only this time, a chunk is chipped out of the stone step at Ali Baba's front door. Again, Morgiana foils the plan by making similar chips in all the other doorsteps, and the second thief is killed for his failure as well. At last, the leader of the thieves goes and looks himself. This time, he memorizes every detail he can of the exterior of Ali Baba's house. The leader of the thieves pretends to be an oil merchant in need of Ali Baba's hospitality, bringing with him mules loaded with 38 oil jars, one filled with oil, the other 37 hiding the other remaining thieves. Once Ali Baba is asleep, the thieves plan to kill him. Again, Morgiana discovers and foils the plan, killing the 37 thieves in their oil jars by pouring boiling oil on them. When their leader comes to rouse his men, he discovers they are all dead and escapes. The next morning, Morgiana tells Ali Baba about the thieves in the jars. They bury them, and Ali Baba shows his gratitude by giving Morgiana her freedom. To exact revenge, the leader of the thieves establishes himself as a merchant, befriends Ali Baba's son (who is now in charge of the late Cassim's business), and is invited to dinner at Ali Baba's house. However, the thief is recognized by Morgiana, who performs a sword dance with a dagger for the diners and plunges it into the thief's heart, when he is off his guard. Ali Baba is at first angry with Morgiana, but when he finds out the thief wanted to kill him, he is extremely grateful and rewards Morgiana by marrying her to his son. Ali Baba is then left as the only one knowing the secret of the treasure in the cave and how to access it. Analysis Classification The story has been classified in the Aarne–Thompson-Uther classification system as ATU 954, "The Forty Thieves". The tale type enjoys "almost universal ... diffusion". Variants A West African version, named