From all accounts, a man who was allegedly trying to steal an iPad from the San Francisco Library's Main branch might have gotten away with the heist, if only he had kept his composure.

According to the Ex, 25-year-old Chris Jones was on the fifth floor of the library, busily wielding "some type of tool" in an effort to liberate one of the library's eNewsCenter iPads, which are used exclusively access content from their periodicals section.

Unfortunately for Jones, his tool proved inefficient, and, in frustration, he "pounded the table with some type of tool and swore in a loud voice," attracting the attention of authorities.

The Ex reports that an SFPL guard and SFPD officer confronted Jones in tandem, but that he ran down to the library's third floor, and tried to blend in with the other patrons. That didn't work, surprisingly, and he was swiftly nabbed.

But Jones was allegedly still unwilling to give up the fight! When the officer tried to escort Jones to the library's security office, he reportedly "put on blue bike gloves and refused to provide any sort of identification." Then he took off, with two library guards and the cop in pursuit. When they caught up to him, he allegedly punched the SFPD officer "several times in the face and head," making a bad situation that much worse.

Jones has been charged with one felony count of assault on an officer, one felony count of threats to an executive officer, misdemeanor commercial shoplifting, misdemeanor possession of burglary tools and misdemeanor giving a false identity to police, the Ex reports. He remains in custody on $170,000 bail.

Related: Here's What You (Still) Can't Do In The Library: The SFPL Revises Their 'Code Of Conduct'