Defendant appeals his conviction for shooting at an occupied building, in violation of NMSA 1978, Section 30-3-8 (Cum. Supp.1991). He contends the instructions given to the jury omitted an essential element of the crime because the instructions did not require that the jury find he knew or should have known the building was occupied at the time of the shooting. Under the instructions given, the jury had only to determine that he willfully discharged a firearm at the building, and that the building was occupied. Defendant argues that Section 30-3-8 proscribes shooting at a building known to be occupied. The State, on the other hand, maintains that the statute applies to any deliberate shooting at a building, whether the defendant knew there was someone in the building or not. While both interpretations of the statute are reasonable, the overall statutory scheme regarding penalties for discharging firearms, precedent from other jurisdictions, and the rule of lenity persuade us to adopt Defendant’s interpretation. Accordingly, we reverse and remand for a new trial at which a proper instruction on the “knowledge” element shall be given.
STANDARD OF REVIEW.
It is the function of the legislature to determine what actions should be prohibited and to define crimes by statute. State v. Grijalva, 85 N.M. 127, 509 P.2d 894 (Ct.App.1973); State v. Dennis, 80 N.M. 262, 454 P.2d 276 (Ct.App.1969). Construing such statutes to determine their meaning is a judicial function. Madrid v. University of Cal., 105 N.M. 715, 737 P.2d 74 (1987). The level of criminal intent required to convict the accused thus becomes a matter of statutory construction by the judiciary. State v. Craig, 70 N.M. 176, 372 P.2d 128 (1962).
Section 30-3-8 defines the offense with which Defendant is charged as “willfully discharging a firearm at an inhabited dwelling house or occupied building or motor vehicle.” The term “willful” has been defined as requiring proof that the person acted intentionally in the sense that he was aware of what he was doing. State v. Sheets, 94 N.M. 356, 366, 610 P.2d 760, 770 (Ct.App.), cert. denied, 94 N.M. 675, 615 P.2d 992 (1980). Both the State and Defendant cite Sheets in support of their interpretations of the statute.
The statute defines “inhabited dwelling” but not “occupied building.” The State argues it is sufficient to establish a violation of the statute if a person intentionally discharges a firearm at a building, and the building happens to be occupied. Defendant argues he must have had reason to believe that the building was occupied at the time the shot was fired. In essence, the State maintains that the term “willfully” modifies only the verb “discharging,” and Defendant argues the term modifies the entire phrase “discharging a firearm at an * * * occupied building.” Defendant tendered an instruction along the lines of his interpretation of the statute, containing as its first element that the “defendant willfully discharged a firearm into an occupied building.”
THE STATUTE IS AMBIGUOUS.
Although each party contends that the language of the statute is clear and requires no construction, we cannot agree. A statute is ambiguous when it can be understood by reasonably well-informed persons in two or more different senses. Kindy v. Hayes, 44 Wis.2d 301, 171 N.W.2d 324 (1969). Each party here has offered what we find to be a plausible interpretation of the facial language of the statute. For example, there is no punctuation separating the “willfully discharging” portion of the statute from the “occupied building” portion. Such punctuation would have indicated an intent to separate the willfulness requirement from the “occupied building” element of the crime. On the other hand, “willfully” is an adverb and “discharging” is the only verb in the sentence, so it is reasonable to assume the adverb modifies only that verb. Moreover, qualifying words are normally to be applied to the phrase immediately preceding and are not *553to be construed as extending to more remote phrases. Cf. Garcia v. Schneider, Inc., 105 N.M. 234, 731 P.2d 377 (Ct.App.1986) (last antecedent doctrine).
The New Mexico appellate courts have recently considered the probable legislative intent behind the prohibition in Section 30-3-8 against shooting into an “occupied * * * vehicle.” . In State v. Gonzales, 113 N.M. 221, 824 P.2d 1023 (1992), our Supreme Court found that the legislature did not intend to punish the same conduct under Section 30-3-8 that is prohibited by the statute defining murder in the first degree, NMSA 1978, § 30-2-1 (Repl.Pamp.1984). In finding that the legislature intended to create separately punishable offenses, the Supreme Court compared the two statutes in the following terms:
The murder statute is designed to avoid the unlawful killing of a person. In contrast, the shooting into an occupied vehicle statute is more narrowly designed to protect the public from reckless shooting into a vehicle and the possible property damage and bodily injury that may result. While death may occur as a result of shooting into an occupied vehicle, we must strictly construe the social purpose protected by each statute. Id. Thus, the statutes protect different social interests.
Gonzales, 113 N.M. at 225, 824 P.2d at 1027. Under Gonzales, then, Section 30-3-8 requires the shooting at an occupied vehicle or building to be “reckless.” Recklessness requires a total disregard for the safety of others. State v. Omar-Muhammad, 102 N.M. 274, 278, 694 P.2d 922, 926 (1985). This might seem to imply the accused should at least have reason to believe their actions might imperil the safety of others and therefore reason to believe the building is occupied at the time of the shooting.
In State v. Highfield, 113 N.M. 606, 830 P.2d 158 (Ct.App.), cert. denied, 113 N.M. 503, 828 P.2d 415 (1992), this Court, also in the double jeopardy context, considered the likely intent of Section 30-3-8. Holding Section 30-3-8 had a different goal than NMSA 1978, Section 30-3-3 (Repl.Pamp.1984) (assault with intent to commit a violent felony), we opined, “In enacting Section 30-3-8, we believe the legislature was concerned with conduct typically designed to terrorize or intimidate.” Highfield, 113 N.M. at 608, 830 P.2d at 160. Persons seeking to terrorize or intimidate are more likely to fire into a building they believe to be occupied so that the targets of the intimidation will “get the message.” Again, therefore, requiring knowledge of the occupancy would appear to be consistent with the intent of the legislature.
This interpretation also seems consistent with the overall statutory pattern criminalizing the discharge of weapons in New Mexico. At the time Section 30-3-8 was enacted in 1987, see 1987 N.M.Laws, ch. 213, § 1, it was a petty misdemeanor to discharge “a firearm into any building or vehicle or so as to knowingly endanger a person or his property.” NMSA 1978, § 30-7-4 (Repl.Pamp.1984) (negligent use of a deadly weapon). Assault with intent to commit murder was a third degree felony. Section 30-3-3.
If Section 30-3-8 is interpreted to require defendants’ knowledge that a building is occupied, it fills a gap in the law. When defendants shot at a building they knew to be occupied at the time and it could not be proved that the defendants had the intent to murder, but “only” the intent to terrorize or intimidate, before 1987 the defendants could only be convicted of a petty misdemeanor under Section 30-7-4. Such defendants could not be convicted of assault with intent to commit murder under Section 30-3-3, a third degree felony. See Highfield, 113 N.M. at 609, 830 P.2d at 161. Section 30-3-8, interpreted to require defendants’ knowledge that the building was occupied, would fill this gap by raising the crime to a fourth degree felony even if no great bodily harm resulted to whoever was inside the building. This interpretation, then, is consistent with the purpose of Section 30-3-8 to address “conduct typically designed to terrorize or intimidate.” Id. at 608, 830 P.2d at 160.
*554On the other hand, interpreting Section 30-3-8 as not requiring defendants to have knowledge that the building was occupied would lead to disproportionate results. Defendants who shoot “so as to knowingly endanger a person” would be guilty of only a petty misdemeanor under Section 30-7-4, while defendants who shoot at a building that they reasonably believe is unoccupied would be guilty of a fourth degree felony if it turns out that someone was, in fact, inside the structure.
A statute must be interpreted as the legislature understood it at the time it was passed, New Mexico State Bd. of Educ. v. Board of Educ., 95 N.M. 588, 624 P.2d 530 (1981), and related statutes should be construed as a whole, Clavery v. Zia Co., 104 N.M. 321, 720 P.2d 1262 (Ct.App.1986). In line with these rules of construction and based on the relative penalties provided, we feel it is most likely the legislature intended Section 30-3-8 to fill a void between Section 30-7-4 and Section 30-3-3 so that the intent required under Section 30-3-8 falls between the intent required in the other statutes. We think it likely, then, the legislature intended the state be obligated to prove the accused knew or should have known that the building at which they were shooting was occupied, before they can be convicted under Section 30-3-8.
LAW FROM OTHER JURISDICTIONS.
This conclusion is reinforced by the interpretation of a similar statute provided by the North Carolina courts. That statute makes it a felony for any person to “willfully or wantonly” discharge a firearm “into any building, structure, vehicle, aircraft, watercraft, or other conveyance, device, equipment, erection, or enclosure while it is occupied.” N.C.Gen.Stat. § 14-34.1 (1986). Like Section 30-3-8, the North Carolina statute does not require the accused to have any knowledge that the building is occupied in order to sustain a conviction. Nonetheless, the North Carolina courts have held that, in order to affirm a conviction under this statute, and even though knowledge was not expressly required by the North Carolina statute or uniform jury instructions, the jury must be instructed that the accused have actual knowledge or reason to believe the building was occupied at the time of the shooting. State v. Hicks, 60 N.C.App. 718, 300 S.E.2d 33 (1983); State v. Furr, 26 N.C.App. 335, 215 S.E.2d 840 (1975). In the seminal case requiring such knowledge, the North Carolina Supreme Court reasoned that, since the statute required that the building be occupied, the protection of the occupants of the building was the “primary concern” of the legislature when it adopted their statute. State v. Williams, 284 N.C. 67, 199 S.E.2d 409, 412 (1973). We cannot say the New Mexico legislature did not have a similar goal in using the term “occupied building.”
The State relies on People v. Jacobus, 17 A.D.2d 223, 234 N.Y.S.2d 190 (1962), in which the New York court interpreted a similar statute in a different manner. The Jacobus court held that there was no requirement that defendants know or have reason to know that the place they are shooting into is public or that persons would be endangered thereby.
In determining to follow North Carolina, rather than New York, we are persuaded by the reasoning of Justice Ransom’s special concurrence in Reese v. State, 106 N.M. 498, 501-03, 745 P.2d 1146, 1149-51 (1987). Relying on Wayne R. LaFave & Austin W. Scott, Jr., Criminal Law 244-45 (2d ed. 1986), Justice Ransom sets forth seven factors that bear on whether a knowledge requirement should be imposed in this case.
One of those factors is legislative history, which, as we have pointed out, favors Defendant’s interpretation of this statute in that the statute appears to fill in a gap. Another factor is the severity of the crime, which in New York was just a misdemean- or, whereas here the crime is a felony. The seriousness of the harm to the public, the defendant’s opportunity to ascertain the true facts, the difficulty prosecuting officials would have in proving the requisite mental state, and the number of expected prosecutions are also factors we be*555lieve favor the interpretation chosen by the North Carolina courts rather than those of New York.
RULE OF LENITY.
Finally, even if we had no method of discerning the legislature’s intent in promulgating Section 30-3-8, the rule of lenity would dictate we adopt Defendant’s interpretation. See State v. Keith, 102 N.M. 462, 697 P.2d 145 (Ct.App.), cert. denied, 102 N.M. 492, 697 P.2d 492 (1985); State v. Ortiz, 78 N.M. 507, 433 P.2d 92 (Ct.App.) (where there is doubt or ambiguity concerning the meaning of a criminal statute, it will be construed against the state which enacted it and in favor of the accused), cert. denied (1967).
FAILURE TO INSTRUCT WAS REVERSIBLE ERROR.
The State points out that Defendant’s position at trial was not that he did not know the building was occupied; instead, Defendant contended he did not commit the shooting at all. If there was no evidence at trial that would support a finding of lack of knowledge of the building’s occupancy, omission of the knowledge instruction would not require reversal under a fundamental error analysis. See State v. Orosco, 113 N.M. 780, 833 P.2d 1146 (1992) (even though “unlawfulness” is an essential element of the crime of criminal sexual contact of a minor, and must be part of the jury instructions, failure to include such an instruction is not fundamental error where there is no suggestion in the evidence that the touching, if it occurred, was lawful). If Defendant properly preserved this issue, we would not engage in a fundamental error analysis. Although Defendant tendered an instruction and argued the issue of knowledge to the court below, it may be that his instruction was not adequate to convey to the jury the necessity of finding the element he claims was lacking. We must, then, examine the record to determine whether there is any evidence that would put the knowledge question at issue. See id. (question is whether there is any evidence or suggestion in the facts that could have put the element of unlawfulness in issue).
The shooting in this case occurred at 6:37 on a Saturday morning. The building Defendant shot at was a tire service business that did not open for business on Saturdays until 8:00 a.m. There was a light on in the building, but it was a light that was regularly used as a night-light. There were a number of vehicles parked in front of the building, but the only person inside was one of the co-owners of the business. This evidence is sufficient to put the element of knowledge at issue. Therefore, even under Orosco, Defendant’s conviction must be reversed and, at the retrial, an instruction on the element of knowledge must be given.
Defendant raised another issue on appeal, concerning the enhancement of his sentence for use of a firearm. The State has conceded that such enhancement was error since use of a firearm is an element of the crime of shooting into an occupied building. See Swafford v. State, 112 N.M. 3, 16, 810 P.2d 1223, 1236 (1991) (element of crime should not be used to enhance another sentence unless legislature clearly so indicates); State v. Haddenham, 110 N.M. 149, 793 P.2d 279 (Ct.App.) (state cannot use prior felony both to prove an element of a crime and as a basis for habitual offender enhancement), cert. denied, 110 N.M. 72, 792 P.2d 49 (1990) and 110 N.M. 183, 793 P.2d 865 (1990). Should Defendant be convicted again, we assume the firearm enhancement will not be applied to his sentence.
We therefore hold that the statute requires not only that the discharge of the firearm be intentional and that it be discharged at a building intentionally, but that the discharge occur with the knowledge or reason to believe that the building was occupied at the time of the shooting. This knowledge that the building is occupied is an essential element of the crime of willfully shooting at an occupied building. The requisite knowledge, of course, may be proved by circumstantial evidence such as *556the type of building shot at, the day and time the shooting occurred, the presence of vehicles parked outside the building, whether any sounds are being emitted from the building, and whether there are any lights on inside the building. Cf. State v. Giddings, 67 N.M. 87, 352 P.2d 1003 (1960) (knowledge that a substance possessed by defendant is a controlled substance may be proved by circumstantial evidence).
Based on the foregoing, Defendant’s conviction is reversed and the case is remanded for a new trial.
IT IS SO ORDERED.
PICKARD and FLORES, JJ., concur.