CHICAGO (AP) — A substitute teacher has been charged with three counts of sexual exploitation of a child after he allegedly touched himself inappropriately in front of students in a Chicago elementary school classroom.

James Ruml, 29, of Chicago, turned himself in last week and appeared in court Saturday, when a judge prohibited him from having contact with anyone under the age of 18 while the case is pending.

According to Cook County prosecutors, Ruml, while substitute teaching in a writing class at Walt Disney Magnet School in the Uptown neighborhood on Chicago’s North Side on Nov. 16, “leaned back in his chair, stretched his legs wide open and began touching his genital area,” as three 11-year-old students watched, the Chicago Sun-Times reported.

Prosecutors, who said Ruml didn’t take any clothes off, allegedly walked to a corner of the classroom where he continued touching himself. He posted bond Saturday and is scheduled to return to court Feb. 3.

Ruml’s attorney, Joseph Cavanaugh, said that Ruml has been a substitute teacher in the Chicago Public Schools district for three years. Cavanaugh noted that there are no allegations that Ruml exposed himself to the students or tried to touch them.

Students reported the alleged incident to a teacher and the 1,500-student school notified police as well as parents in November. The school’s Principal Paul Ruskis said in a note to parents that the alleged incident happened on the substitute teacher’s first day at the school.