The appellant, Jason Andrew Murphy, was indicted for one count of criminal mischief in the first degree, a violation of § 18A-7-21, Ala.Code 1975; one count of burglary in the second degree, a violation of § 13A-7-6, Ala.Code 1975; one count of making a terrorist threat, a violation of § 13A-10-15, Ala.Code 1975; and five counts of attempted murder, a violation of §§ 13A-4-2 and 13A-6-2, Ala.Code 1975. Murphy subsequently filed a motion requesting that he be treated as a youthful offender. Following a hearing, the circuit court denied Murphy’s request for youthful-offender status. Thereafter, Murphy was convicted of one count of criminal mischief, one count of second-degree burglary, one count of making a terrorist threat, and one count of attempted murder. The circuit court sentenced Murphy to 10 years’ imprisonment for the first-degree criminal-mischief conviction; 15 years’ imprisonment for the second-degree burglary conviction; 10 years’ imprisonment for the making-a-terrorist-threat conviction; and 35 years’ imprisonment for the attempted-murder conviction, the sentences to be served consecutively. Additionally, the court ordered Murphy to pay a $2,000 fine and $1,000 to the crime victims compensation fund for each of the four convictions.
The evidence presented at trial established the following pertinent facts. On Thursday, February 1, 2007, Murphy, who was then living in Auburn, was in Dothan visiting his mother, Sharon Murphy. Murphy was congested, had a stuffy nose, and was coughing periodically. Murphy’s mother, a registered nurse, took Murphy to PrimeCare in Dothan, where he was examined by Dr. Steve Sherrer. After an examination, Dr. Sherrer prescribed Ave-lox (an antibiotic), Tessalon Perles (cough medicine), and Sudex (to reheve congestion). Dr. Sherrer also provided Murphy with an injection of Kenalog (a steroid for inflammation). Murphy took the Avelox *536and the Sudex that evening, but was awake for most of the night because of a severe headache. At this time, Murphy-experienced no problems with his memory and was not confused in any manner.
The following morning Murphy called PrimeCare to complain about his headache, and Dr. Sherrer prescribed Darvocet (pain medication), a drug to which Murphy may have been allergic. Later that day Murphy went back to PrimeCare, where he was examined by Dr. Michael Williams. Dr. Williams diagnosed Murphy with an ear infection, muscle-tension headaches, and neck strain. Dr. Williams was notified that Murphy, who was a member of the United States National Guard at the time, had a physical-fitness test with the National Guard the following day. Dr. Williams wrote a doctor’s excuse for Murphy, recommending that Murphy not participate in rigorous physical activity. That evening Murphy was again awake and talking with his mother until about 6:00 a.m.
The next day Murphy had to wake at 6:30 a.m. to attend drill with the National Guard. After drill, Murphy came home exhausted. Murphy’s mother testified that Murphy was experiencing problems with his “speech patterns ... where his train of thought was not very good.” (R. 1335.) Murphy was also confused and disoriented for most of the evening. Murphy again slept very little, talking with his mother until around 5:00 a.m., even though he had to attend National Guard drill the following day.
At drill the next day Murphy ignored Dr. Williams’s warnings and attempted to take the physical-fitness test. During the test, Murphy experienced chest pains, vomited, and passed out. Murphy was taken by a National Guard medic to Southeast Alabama Medical Center, where he stayed for approximately three hours. Murphy declined treatment and checked himself out of the hospital because he was feeling better.
The following morning Murphy and his mother went to see Dr. Warren Rollins, an ear, nose, and throat specialist. Dr. Rollins examined Murphy and diagnosed him with a sore throat. Dr. Rollins recommended Murphy undergo a chest X-ray and an EKG and that Murphy discontinue the use of Avelox because it could cause heart damage. During the examination Rollins noted Murphy showed “no signs of acute distress” and Murphy exhibited no speech, concentration or orientation problems. (R. 1364.)
Murphy and his mother left Dr. Rollins’s office at approximately 9:00 a.m., and returned home so they could make an appointment with PrimeCare for the chest X-ray and EKG. When Mrs. Murphy could not get an appointment for her son, she told Murphy to lay down and told Murphy that she would take him to another doctor when she got home from filling his prescriptions.
While Mrs. Murphy was out, Murphy left his mother’s home and drove to Prime-Care at approximately 9:45 a.m. Murphy entered PrimeCare agitated and angry, holding numerous bottles of medicine in his hands. Murphy approached the receptionist, Robin Dunn, and screamed “you gave me too much medicine, you are trying to make me have a heart attack.” (R. 137.) Christie McLean, the office manager, heard Murphy screaming and took him from the lobby to an examination room. At this time, McLean believed Murphy was agitated but coherent.
Murphy was then examined by Dr. Joseph Sewell, who noted Murphy’s blood pressure and heart rate were a bit higher than normal, but not dangerously high. Dr. Sewell ordered the chest X-ray and found no abnormalities. Dr. Sewell pre*537scribed Mobic (an anti-inflammatory) and Albuteral (an inhaler) for Murphy; he directed Murphy to continue taking the antibiotics as he had been prescribed. As Murphy left PrimeCare, he looked at Dunn, smiled and calmly stated, “I’m going to the bank. I’m coming back to see you.” (R. 141-42.)
Not long thereafter, Michael Wright, an Iraq war veteran who had come to Prime-Care for a job-related physical, looked outside the waiting-room window and saw Murphy marching in “parade formation,” wearing a camouflage helmet and carrying a M14 rifle on his shoulder. (R. 762.) Wright stepped outside of PrimeCare and telephoned the police.
Dunn, whose reception desk faced PrimeCare’s glass front doors, also saw Murphy’s return. Murphy walked in the building and started firing his weapon. He shattered the glass windows that lined the front of the building and shot out the glass walls that separated the reception area from the waiting room. Dunn ducked as the shooting started, then ran and hid in an examination room with a few patients, believing that each shot fired was likely killing someone. As patients fled from the lobby and staff members scrambled to get out of the line of fire, Murphy began yelling, “I’m not here to hurt y’all. Get out, get out. I’m not mad with y’all- I’m mad with the army.” (R. 700-01.) Murphy was “upset” because of the difficulty he was having in getting a medical clearance from the National Guard for deployment to Iraq. (R. 1099.)
Jennifer Herring, human-resources director at PrimeCare, was in an examination room when she heard loud screaming. Herring ran to the reception area and saw employees crouched down and hiding and Murphy holding a gun and wearing his helmet. Once Herring saw the waiting room area was empty and that no patients or staff were in immediate harm, she went to McLean’s office. McLean had telephoned the police to report Murphy’s attack. McLean and Herring then escaped out the back door and ran to the top of the hill behind the PrimeCare facility.
When Herring realized other employees were still in the facility, she returned to the building with McLean to try and help as many people escape as possible. Herring was in the doorway of an exam room looking for patients when she heard another shot. Murphy had shot blindly through a closed door at the end of a hallway; the bullet passed by Herring and struck the lead wall of the X-ray room, causing the bullet to fragment. A fragment of the bullet grazed Herring, tearing her blouse and drawing a small amount of blood. This was the last shot fired by Murphy.
After all the employees and patients escaped from PrimeCare, a standoff ensued. Dothan Police Officer Frank Meredith was the negotiator on the scene. When Officer Meredith pulled up to the building he was under the impression that the gunman had fled; he was very surprised to see Murphy pointing a gun directly at him upon his arrival at PrimeCare. Officer Meredith ducked for cover behind the outer wall of the building and yelled his cellular phone number to Murphy. Murphy telephoned him; this contact led to three hours of negotiations, with frequent breaks where Meredith and Murphy would hang up and then call each other back. Murphy asked about the potential criminal charges that he faced; Murphy was especially interested in whether he would be charged with misdemeanors or with felonies. The police negotiators gave the phone to Assistant District Attorney David Atwell, who told Murphy to “stop this before it does turn out worse. You know, right now you may just be looking at broken windows.” (R. 1105-06.) Shortly after this conversation, *538Murphy put down his weapon, left Prime-Care, and was arrested by the SWAT team. The arresting officers found a handgun, a large amount of ammunition, and a knife in the PrimeCare lobby that Murphy had brought along with him but never used during the attack.
At trial, Murphy based his defense on a theory of temporary, drug-induced psychosis. The circuit court ordered Dr. Doug McKeown, a clinical and forensic psychologist, to determine Murphy’s mental state at the time he attacked the PrimeCare facility and to determine whether Murphy was competent to stand trial. Dr. McKeown reviewed numerous documents provided by the State and by Murphy, and interviewed Murphy when making his determination on Murphy’s mental state. Murphy was determined to be competent to stand trial.
At trial, the State offered expert testimony from Dr. McKeown. Dr. McKeown testified:
“[I]t was my opinion that he was capable of appreciating the nature and quality of his actions and behavior at that time; that the reports and information available were that he was taking different medications which could have had some type of an effect on him, but not to the point that it would have prevented him from carrying out purposeful behavior or knowing the difference between right and wrong.”
(R. 327.) McKeown also testified that Murphy’s actions during the police standoff, such as his negotiations with the police and his request for legal advice, suggested purposeful activity and the ability to reason — mental processes inconsistent with delirium or psychosis.
In addition to Dr. McKeown, the State presented testimony from the doctors who treated Murphy during the days leading up to the attack at the PrimeCare facility. The doctors who treated Murphy agreed that after examining Murphy there was nothing to indicate mental problems, even after Murphy had taken a number of prescription drugs. Dr. Sewell, the last doctor to see Murphy before the attack, wrote on Murphy’s chart “[ojriented times three, normal mood, affect, and normal cranial nerves as tested,” indicating that Murphy was normal after neurologic/psychiatric testing only a few minutes before his armed return to PrimeCare. (R. 437.)
Murphy offered expert testimony of two expert witnesses as part of his defense. Murphy’s expert witnesses presented testimony that conflicted with that of the State’s expert witnesses. Dr. Michael D’Errico, a forensic psychologist, performed a psychological evaluation of Murphy, interviewed Murphy’s brother and mother by telephone, and reviewed Murphy’s medical records from Southeast Alabama Medical Center, PrimeCare, and Dr. Rollins. It was Dr. D’Errico’s opinion that
“Mr. Murphy was experiencing side effects from a medication which caused him to vomit, feel nauseous, and become dehydrated, and his psychological — I mean his speech, his ability to orient himself to time, his ability to focus his attention, all of which were deteriorated at the time just prior to the offense, were representative of a substance-induced state of delirium.”
Dr. D’Errico testified that these combined factors would have impacted Murphy’s decision making and behavior. (R. 1138-39.)
In addition to Dr. D’Errico, Murphy also provided expert testimony from Dr. Brandi Odom, a doctor of pharmacy. Dr. Odom provided information about the various prescription medications taken by Murphy and testified that “given the medications that [Murphy] was taking, and from the interviews that I had and the information *539that I gathered, in my opinion I think that Mr. Murphy experienced drug-induced psychosis or drug-induced central nervous system effects which contributed to his actions around the time of the alleged offense.” (R. 1238.)
After both sides rested, the circuit court instructed the jury on the applicable principles of law. The jury returned a verdict finding Murphy guilty of one count of criminal mischief, one count of second-degree burglary, one count of making a terrorist threat, and one count of attempted murder as to Herring. This appeal followed.
I.
Murphy first contends that the circuit court erred by denying his request for youthful-offender status. Specifically, Murphy contends that his age, social history, and the fact that no one sustained physical injuries as a result of his criminal conduct support a finding that he should have been treated as a youthful offender. Nothing in the record indicates that Murphy objected to the circuit court’s denial of his request for youthful-offender status. Therefore, this issue was not properly preserved for our review. See Harris v. State, 794 So.2d 1214 (Ala.Crim.App.2000) (by failing to object, the appellant did not preserve for review whether trial court erred by denying his request for youthful-offender status); Withee v. State, 728 So.2d 684 (Ala.Crim.App.1998) (issue whether trial court erred by failing to grant defendant youthful-offender status was not preserved for review where defendant did not file a contemporaneous objection).
In any event, even, if the issue had been preserved for appellate review, Murphy would not be entitled to relief. A trial court has almost absolute discretion in deciding whether to grant or to deny a defendant’s application for youthful-offender status, and this Court will not overturn such a decision absent an affirmative showing that the decision was arbitrary or that it was made without some investigation or examination of' the defendant. Burks v. State, 600 So.2d 374 (Ala.Crim.App.1991). The trial court need not articulate on the record its reasons for denying a defendant youthful-offender status. Reese v. State, 677 So.2d 1239 (Ala.Crim.App.1996). “All that is required is that the trial court undertake an examination of the defendant sufficient to enable it to make an intelligent determination as to whether, in its discretion, the defendant is eligible for treatment as a youthful offender.” Gamble v. State, 791 So.2d 409, 419 (Ala.Crim.App.2000) (citing Fields v. State, 644 So.2d 1322 (Ala.Crim.App.1994)). “Generally, the trial court considers the nature of the crime charged, any prior convictions, the defendant’s age, and any other matters deemed relevant by the court.” Reese v. State, 677 So.2d at 1240.
In the instant case, the circuit court conducted a hearing on Murphy’s application for youthful-offender status. The record indicates that the circuit court considered the youthful-offender investigation report as well as the arguments of both parties at the hearing before denying Murphy’s request to be treated as a youthful offender. Therefore, we cannot say that the circuit court abused its discretion by denying Murphy’s application for youthful-offender status.
II.
Murphy also contends that the circuit court erred in denying his motion for a judgment of acquittal because, he argues, the State failed to present sufficient evidence to sustain his convictions for attempted murder and second-degree burglary.
*540“ ‘ “In determining the sufficiency of the evidence to sustain a conviction, a reviewing court must accept as true all evidence introduced by the State, accord the State all legitimate inferences therefrom, and consider all evidence in a light most favorable to the prosecution.” ’ Ballenger v. State, 720 So.2d 1033, 1034 (Ala.Crim.App.1998), quoting Faircloth v. State, 471 So.2d 485, 488 (Ala.Crim.App.1984), aff'd, 471 So.2d 493 (Ala.1985). ‘“The test used in determining the sufficiency of evidence to sustain a conviction is whether, viewing the evidence in the light most favorable to the prosecution, a rational finder of fact could have found the defendant guilty beyond a reasonable doubt.” ’ Nunn v. State, 697 So.2d 497, 498 (Ala.Crim.App.1997), quoting O’Neal v. State, 602 So.2d 462, 464 (Ala.Crim.App.1992). ‘“When there is legal evidence from which the jury could, by fair inference, find the defendant guilty, the trial court should submit [the case] to the jury, and, in such a case, this court will not disturb the trial court’s decision.” ’ Farrior v. State, 728 So.2d 691, 696 (Ala.Crim.App.1998), quoting Ward v. State, 557 So.2d 848, 850 (Ala.Crim.App.1990). ‘The role of appellate courts is not to say what the facts are. Our role ... is to judge whether the evidence is legally sufficient to allow submission of an issue for decision [by] the jury.’ Ex parte Bankston, 358 So.2d 1040, 1042 (Ala.1978).
“‘The trial court’s denial of a motion for judgment of acquittal must be reviewed by determining whether there was legal evidence before the jury at the time the motion was made from which the jury by fair inference could find the defendant guilty. Thomas v. State, 363 So.2d 1020 (Ala.Cr.App.1978). In applying this standard, this court will determine only if legal evidence was presented from which the jury could have found the defendant guilty beyond a reasonable doubt. Willis v. State, 447 So.2d 199 (Ala.Crim.App.1983). When the evidence raises questions of fact for the jury and such evidence, if believed, is sufficient to sustain a conviction, the denial of a motion for judgment of acquittal does not constitute error. McConnell v. State, 429 So.2d 662 (Ala.Crim.App.1983).’ ”
Gavin v. State, 891 So.2d 907, 974 (Ala.Crim.App.2003), cert. denied, 891 So.2d 998 (Ala.2004) (quoting Ward v. State, 610 So.2d 1190, 1191 (Ala.Crim.App.1992)).
A.
Murphy first contends that the State presented insufficient evidence from which the jury could conclude that he attempted to murder Herring. Specifically, Murphy argues that the State failed to present sufficient evidence of his specific intent to murder Herring. The State concedes that “there was no evidence indicating that Murphy intended to kill Jennifer Herring, the victim in the sole attempted murder count under which [Murphy] was- convicted.” (State’s brief, p. 30.)
“The elements of the crime of attempted murder are intent to kill and an overt act towards commission of that act.” Bradford v. State, 734 So.2d 364, 369 (Ala.Crim.App.1999) (citing Chaney v. State, 417 So.2d 625 (Ala.Crim.App.1982)).
“ ‘Attempted murder is a specific intent crime.... An attempt to commit murder requires the perpetrator to act with the specific intent to commit murder. ... A general felonious intent is not sufficient.’ Free v. State, 455 So.2d 137, 147 (Ala.Cr.App.1984). To establish a prima facie case of attempted murder, the State must present evidence of the accused’s specific intent to kill, and of ‘some overt act in part execution of the *541intent to commit the crime ... which falls short of the completed crime; the difference between attempt and commission being that the act or step fails to produce the result intended.’ Broadhead v. State, 24 Ala.App. 576, 139 So. 115, 117 (1932).”
Minshew v. State, 594 So.2d 703, 704 (Ala.Crim.App.1991).
Our review of the record indicates there was insufficient evidence to support Murphy’s conviction for attempted murder. Murphy shot through a closed door, and it was impossible for Murphy to see what or who was behind that door when it was closed. Testimony at trial also demonstrated that Murphy was not aware that anyone was behind the door. While the shot could have hit Herring had she been in the hallway behind the door, that possibility alone does not show Murphy had the specific intent to commit murder when he fired the shot. Because the State presented no evidence indicating that Murphy intended to murder anyone when he shot into the hallway, the circuit court erred in denying Murphy’s motion for a judgment of acquittal as to the charge of attempted murder.
B.
Murphy further contends that the State failed to prove a prima facie case of second-degree burglary because, he argues, the State failed to prove that he unlawfully entered PrimeCare or that he unlawfully remained at PrimeCare with the intent to commit theft or a felony. Murphy contends that his presence at PrimeCare was not unlawful because, he says, he had license to be in the public areas of the facility and that license was never revoked. Murphy also contends that he could not have formed the requisite intent to commit a felony within Prime-Care because testimony of psychological experts at trial showed that his behavior resulted from a “drug-induced psychosis and/or drug Central Nervous System effects.” (Murphy’s brief, p. 39.)
“(a) A person commits the crime of burglary in the second degree if he or she knowingly enters or remains unlawfully in a building with intent to commit theft or a felony therein and, if in effecting entry or while in the building or in immediate flight therefrom, the person or another participant in the crime:
“(1) Is armed with explosives; or
“(2) Causes physical injury to any person who is not a participant in the crime; or
“(3) In effecting entry, is armed with a deadly weapon or dangerous instrument or, while in the building or in immediate flight from the building, uses or threatens the immediate use of a deadly weapon or dangerous instrument against another person....”
§ 13A-7-6(a), Ala.Code 1975. Alabama’s burglary statute further provides that “[a] person ‘enters or remains unlawfully in or upon premises when he is not licensed, invited or privileged to do so.” § 13A-7-1(4) Ala.Code 1975. “An unlawful entry or unlawful remaining constitutes the tres-passory element of burglary, which element, when coupled with the intent to commit a crime inside, forms the nucleus of the burglary offense.” Davis v. State, 737 So.2d 480, 482 (Ala.1999).
Our review of the record indicates that the State presented sufficient evidence from which the jury could have concluded that Murphy remained unlawfully on the premises of PrimeCare. The Alabama Supreme Court discussed the issue of unlawful remaining in Davis v. State, 737 So.2d 480. In Davis, the defendant was convicted of first-degree burglary after he entered the mobile home of an acquaintance, strangled her with a cord, and then stole a *542$50 money order. This Court overturned Davis’s conviction, finding that the State failed to present evidence indicating that Davis had entered the mobile home, or had remained in the mobile home, unlawfully. The Alabama Supreme Court reversed this Court’s judgment, holding: “Evidence of a struggle that gives rise to circumstantial evidence of revocation of a license or privilege can be used to show an unlawful remaining, a separate prong of the offense of burglary upon which a conviction can be based.” Davis, 787 So.2d at 483. After Davis, “[t]he State is no longer required to prove that the defendant broke and entered the premises. Instead, the strictures of that element have been replaced with the general requirement of a trespass on premises through an unlawful entry or an unlawful remaining.” Id.
The Davis Court also recognized that the termination of a license can be implied through circumstantial evidence. Davis, 737 So.2d at 483-84. First, the Davis Court stated that commission of a crime on the premises alone is not enough to create an implied termination of license. For instance, “evidence of a privileged entry followed by death from an injury inflicted by surprise or stealth and causing instantaneous death would not constitute circumstantial evidence of an unlawful remaining.” Davis, 737 So.2d at 485. However, the Supreme Court found that a less-than-instantaneous method of killing, like strangulation, or a struggle before death can create the inference of an implied revocation of a license, because “the jury reasonably could have found that [the defendant], from the point at which he began committing his criminal acts, remained unlawfully in [the victim’s] home with the intent to commit a crime.” Id. at 485. Our Supreme Court’s discussion in Davis demonstrates that the inference of unlawful remaining is permitted when the li-censor is aware of the commission of a crime on the premises, and the licensor’s reaction to the commission of that crime demonstrates that the perpetrator’s license to be on the premises has been revoked.
In the instant case, Murphy entered the publicly accessible areas of the PrimeCare facility with an M14 automatic rifle, a significant amount of ammunition, and a military helmet. Murphy then shot out the windows in the front of the building, shot out the glass in the reception area, and shot other items in the building. Murphy also shot through a doorway, just missing two PrimeCare employees. When Murphy started shooting, the patients and staff of PrimeCare fled from the building in terror. The PrimeCare staff and patients telephoned the police to remove Murphy from the building because they could not do so themselves in light of the danger Murphy presented. The reaction of PrimeCare’s employees to Murphy’s criminal acts implied that any license he may have had to be on the premises was revoked. The intent to revoke Murphy’s license was evidenced by the flight of all the PrimeCare staff and patients and their calling the police after Murphy started shooting. Therefore, the State provided sufficient circumstantial evidence from which the jury could infer that Murphy remained unlawfully on the premises of PrimeCare.
The record also indicates that the State presented sufficient evidence to support a conclusion by the jury that Murphy had the requisite intent to commit a felony when he entered PrimeCare. In a prosecution for second-degree burglary the intent of the defendant “must be inferred by the jury from a due consideration of all of the material evidence.” Rivers v. State, 624 So.2d 211, 213 (Ala.Crim.App.1993). The record indicated that Murphy took an M14 rifle, a pistol, a knife, *543a military helmet, and a significant amount of ammunition with him when he went to PrimeCare. Murphy also parked his vehicle behind PrimeCare near a park, well away from the parking lot where patients typically left their vehicles. While inside PrimeCare, Murphy committed two felonies. Murphy destroyed property worth at least $2,500 during his occupation of PrimeCare, constituting the felony of criminal mischief, a violation of § 13A-7-21. Murphy also terrorized PrimeCare’s employees and patients, constituting the felony of making terrorist threats, in violation of § 13A-10-15. Because the jury is allowed to infer intent “from a due consideration of all of the material evidence,” Rivers, 624 So.2d at 213, and because the material evidence indicated that Murphy entered PrimeCare with guns and live ammunition, then used the guns and live ammunition to commit two felonies, the logical inference is that Murphy intended to commit those felonies when he entered PrimeCare.
Murphy argues that his intent to commit those felonies should be negated because, he says, his drug-induced psychosis made it impossible for him to control his behavior. The jury was presented with conflicting evidence on this point. Murphy’s expert, forensic psychologist Dr. D’Errico, testified that the medications Murphy took during the week leading up to the incident at PrimeCare could have caused a substance-induced state of delirium, impacting Murphy’s ability to make decisions and to regulate his behavior. However, Dr. McKeown, the State’s forensic psychologist, testified that despite taking many medications, Murphy had the ability to appreciate the nature and quality of his actions and behavior while at PrimeCare.
“[Cjonflicting evidence presents a jury question which is not subject to review on appeal.” Barnes v. State, 571 So.2d 372, 374 (Ala.Crim.App.1990) (citing Willis v. State, 447 So.2d 199, 201 (Ala.Crim.App.1983)). “ ‘The weight of the evidence, and the credibility of the witnesses, and inferences to be drawn from the evidence, where susceptible of more than one rational conclusion, are for the jury alone.’ ” Turrentine v. State, 574 So.2d 1006, 1009 (Ala.Crim.App.1990) (quoting Walker v. State, 416 So.2d 1083, 1089 (Ala.Crim.App.1982)). Although conflicts in the evidence existed, the State’s evidence, when considered as a whole, could have permitted the jury to reasonably conclude that Murphy intended to commit the felonious crimes that formed the basis for his second-degree burglary conviction.
Reviewing the evidence in a light most favorable to the State, we conclude that there was sufficient evidence to present the second-degree burglary charge to the jury. Therefore, the circuit court did not err in denying Murphy’s motion for a judgment of acquittal as to that charge.
III.
Finally, Murphy contends that the circuit court erred when it gave the jury the following charge:
“I charge you ladies and gentleman that ‘unlawfully remains’ includes a situation where the victim terminated the defendant’s license or privilege to remain on the premises and can be inferred where a shooting took place on the premises.”
(C. 104; R. 1411.) Murphy specifically contends that the circuit court’s charge amounted to an incorrect statement of the law and unduly prejudiced him. Relying on Davis v. State, supra, Murphy argues that “evidence of a commission of a crime, standing alone, is inadequate to support the finding of unlawful remaining” and therefore that it is improper for the jury to infer that a shooting on the premises auto*544matically terminates a license to be there. (Murphy’s brief, p. 40.)
“ ‘A trial court has broad discretion in formulating its jury instructions, provided they are an accurate reflection of the law and facts of the case.’ ” Toles v. State, 854 So.2d 1171, 1175 (Ala.Crim.App.2002) (quoting Coon v. State, 494 So.2d 184, 186 (Ala.Crim.App.1986)).
Our review of the record indicates the circuit court’s use of the State’s requested charge number 10 accurately reflected the law and facts of the case. As discussed above, the Alabama Supreme Court’s decision in Davis offers guidance for when it is permissible for the jury to infer unlawful remaining for the purposes of a second-degree burglary conviction. In short, so long as the licensor is aware of the crime being committed and takes action inconsistent with the continuation of the license, that action acts as an implied revocation of the license, and the licensee’s further remaining on the premises becomes unlawful.
In the instant case, Murphy made PrimeCare’s patients and staff very aware of the commission of his crimes. Murphy shot an M14 assault rifle multiple times in the waiting room of a crowded medical facility. As soon as Murphy started shooting, the patients and staff of PrimeCare ran from the facility and telephoned the police. There is no question that the people inside PrimeCare were aware that the shooting had taken place, and there is no question that their reaction was inconsistent with Murphy’s retaining a license to remain lawfully on the premises. Requiring the staff of PrimeCare to ask Murphy to leave as he is shooting up the premises is unreasonable; their flight from the danger presented by Murphy is enough for the jury to infer Murphy’s license to remain at PrimeCare was revoked. Because of the timing and location of the shooting, there was no error on the part of the circuit court when it charged the jury that a shooting on the premises of PrimeCare created the inference that Murphy unlawfully remained on the premises.
Moreover, even if the jury charge that allowed the jury to infer that the license to remain at PrimeCare had been revoked solely because Murphy began shooting was in error, Murphy was not prejudiced by such a charge. “After finding error, an appellate court may still affirm a conviction or sentence on the ground that the error was harmless, if indeed it was.” Davis v. State, 718 So.2d 1148, 1164 (Ala.Crim.App.1995), aff'd, 718 So.2d 1166 (Ala.1998). Rule 45, Ala. R.App. P., provides, in pertinent part:
“No judgment may be reversed or set aside, nor new trial granted in any civil or criminal case on the ground of misdirection of the jury, the giving or refusal of special charges or the improper admission or rejection of evidence ... unless in the opinion of the court to which the appeal is taken or application is made, after an examination of the entire cause, it should appear that the error complained of has probably injuriously affected substantial rights of the parties.”
“The purpose of the harmless error rule is to avoid setting aside a conviction or sentence for small errors or defects that have little, if any, likelihood of changing the result of the trial or sentencing.” Davis, 718 So.2d at 1164.
Our examination of the record indicates that there was overwhelming evidence indicating that Murphy remained unlawfully at the PrimeCare facility. Murphy did much more than just shoot in a publicly accessible place; he terrorized a crowded medical building, shot in the general direction of patients and staff, and forced *545the PrimeCare staff to call the police because he was too dangerous to remove from the premises without help from the authorities. After the police arrived on the scene, Murphy remained at PrimeCare for another three hours until the police negotiated his surrender. These facts alone are enough to satisfy the unlawful-remaining element of second-degree burglary. Because the jury charge could have had no substantial impact on Murphy’s rights, any error in the jury charge was harmless beyond a reasonable doubt.
Conclusion
Based on the foregoing, Murphy’s convictions for one count of first-degree criminal mischief, one count of second-degree burglary, and one count of making a terrorist threat are affirmed. However, for the reasons set forth in Part II.A. of this opinion, Murphy’s conviction for the attempted murder of Jennifer Herring is due to be set aside and a judgment rendered in Murphy’s favor.
AFFIRMED IN PART; REVERSED AND JUDGMENT RENDERED IN PART.
WINDOM, P.J., and WELCH, BURKE, and JOINER, JJ., concur.