Robots can do many different jobs, but one thing they hadn’t yet figured out—aside from a few well-timed beeps and quips between R2D2 and C3PO—was how to make people laugh.

Now there’s a robot in Japan with its own standup routine.

Professor Atsuo Takanishi of Japan’s Waseda University and his team have spent the better part of the last decade developing KOBIAN, an emotionally expressive biped android platform equipped with a double-jointed neck and motors to move its lips, eyelids and eyebrows to convey both facial expressions and body language.

Imagine a robot resembling a cross between a ventriloquist dummy and The Joker asking,

“Why was the robot angry?”

“Because someone kept pushing its buttons!”

Recently, Takanishi and his team have started teaching KOBIAN how to tell jokes. They’ve even come up with a comedic rulebook to govern the robot’s jokes and skits. The team presented a paper entitled “Bipedal Humanoid Robot That Makes Humans Laugh With Use of the Method of Comedy and Affects Their Psychological State Actively” at the 2014 IEEE ICRA Conference, which lays out methods for making humans laugh.

(Related: Poppy: Another open-source android platform)

To come up with the rules, the researchers read books on comedy, then wired up test subjects with sensors, pointed cameras at their faces, measured whether they smiled or laughed at jokes, and made them complete mood questionnaires before and after. Who wouldn’t be inclined to chuckle under those circumstances?

Here are some of the robot joke-telling rules they came up with:

1) Funny behavior
• Overblown: Exaggerated things
• Equivoque: Homonyms or puns
• Blue jokes: Made a dirty joke
• Sympathetic story: Said small, empathetic things that almost everyone has experienced once
• Induced laugh: Comedian laughs were aimed at the audience’s infectious laugh

2) Funny context
• Running gag: Used the same story again and again
• Unexpected: Did completely unexpected behavior

3) Funny character
• Self-flattery, Self-deprecating humor
• Imitation

According to the IEEE, the researchers plan to devise more complex skits combining different comedy techniques, and they will experiment with sending audience feedback to the robot after a joke to alter its routine. Below is a video showing a few sketches from KOBIAN’s standup routine. Some of the cultural jokes and skits based on Japanese celebrity impersonations may get lost in translation, but decide for yourself whether KOBIAN has a future in comedy.

Robots are taking over more and more jobs every day. They work on assembly lines, drive cars, clean floors and fight wars. Soon you’ll even be able to bake your own robot. As for comedy, some things may be better left to humans.