*636OPINION
By the Court,
Hardesty, C.J.:In this appeal, we address two issues related to recent amendments to the deadly weapon enhancement statute, NRS 193.165(1), that require the district court to consider enumerated factors and state on the record that it has considered the factors in determining the length of the enhancement sentence.1 First, we con*637sider whether these amendments to NRS 193.165(1) violate the separation-of-powers doctrine. Although we conclude that the amended statute violates the separation-of-powers doctrine to the extent that it requires the courts to state on the record that the enumerated factors have been considered and to make specific findings in that respect, we nonetheless elect to abide by the mandate contained therein because it serves a laudable legislative goal with respect to the length of enhancement sentences and facilitates appellate review. Second, we consider whether NRS 193.165(1) requires the district court to make findings on the record before imposing a sentence enhancement for the use of a deadly weapon. We conclude that it does and that findings must be made for each enhancement. Applying our holding to the instant case, we conclude that the district court’s failure to make the required findings for two of appellant Douglas Mendoza-Lobos’ enhancements does not amount to plain error warranting reversal of his conviction and sentence.2 Therefore, we affirm the judgment of conviction.
RELEVANT FACTS AND PROCEDURAL HISTORY
Mendoza-Lobos was convicted, pursuant to a jury verdict, of burglary, robbery with the use of a deadly weapon, sexual assault with the use of a deadly weapon, attempted sexual assault with the use of a deadly weapon, assault with a deadly weapon, and battery with a deadly weapon.
At sentencing, the district court heard argument from defense counsel and the State, and listened to the victim’s impact statement and Mendoza-Lobos’ statement in allocution. Before pronouncing sentence, the State reminded the district court that, pursuant to NRS 193.165, it was required to make “finding[s] on the record” regarding the sentences imposed for deadly weapon enhancements. The district court then made the following statement:
Well, there are several of these charges that involve the use of a deadly weapon. And it looks like we have No. n, No. IH and No. IV all on additional terms for the use of a deadly weapon. The statute NRS 193.167 [sic] talks about the enhancement for the use of a deadly weapon and calls on the *638court to consider the following information which are: the facts and circumstances of the crime or criminal violation, also the criminal history of the person, the impact of the crime or criminal violation on a victim, also any mitigating factors presented by the person and any other relevant information. And certainly when you look at the facts and circumstances of the crime or criminal violations, you know, this is a sexual assault at gunpoint, you know, a very, very serious crime. Hardly any crime could be worse than this one.
In addition, when you look at the impact of the crime on the victim and, you know, the victim we have here is just [sic] Ms. Quintero, but also the gentleman who arrived there was certainly also a victim and put into great anxiety, I’m sure, when the pistol was pointed at him and trigger pulled and he hears the click of the hammer. You know, you might think this is the end.
So, you know, when especially I hear Ms. Quintero, you know, talk about her circumstance and how she’s been violated and ultimately now she will be forced to move, and something tells me that that would be reasonable for almost anybody in that same circumstance, is that you just couldn’t remain in the same place and feeling alone and vulnerable there, at least some other place she could get a fresh start and a much better chance of coming to a more normal mental state in her home.
With regard to the criminal history, there is in fact a fairly minimal criminal history here. It’s not nonexistent, but it’s just careless driving and a minor in possession of alcohol. So, you know, in looking at all of these factors, the very serious nature of the crime and mitigation, et cetera, of course there isn’t much in mitigation in a way when you look at the evaluation that Steven Ing has prepared, it doesn’t portray a mental state for Mr. Mendoza-Lobos that’s very favorable at all. Looks like he’s somebody who does need extensive, you know, change of mind-set to be prepared to live out in society again and not be a serious threat. So I do find that the proposals for consecutive additional time due to the use of a deadly weapon are well appropriate.
Mendoza-Lobos did not object to the sufficiency of the district court’s compliance with and findings under NRS 193.165(1).
The district court sentenced Mendoza-Lobos to serve various consecutive prison terms totaling 35 years to life. For the enhanced offenses, the district court imposed an enhancement sentence that was equal to the sentence for the underlying offense (48-120 months) with respect to the charges of robbery with the use of a deadly weapon and attempted sexual assault with the use of a deadly weapon and an enhancement sentence at the top end of the *639enhancement range (96-240 months) for the sexual assault with the use of a deadly weapon.
DISCUSSION
On appeal, Mendoza-Lobos contends that the district court failed to comply with NRS 193.165(1) in imposing the sentences for the deadly weapon enhancements because it failed to articulate sufficient findings on the record. However, as a threshold matter, we first elect to address the State’s claim, raised during oral argument, that the Legislature lacks the power to require the district courts to consider specific factors and to state on the record that they have considered those factors when determining the length of the enhancement sentence.
Legislative authority
The State contends that because NRS 193.165(1) compels the district courts to consider certain factors when imposing sentences for deadly weapon enhancements and to state on the record that they have done so, the statute infringes on the power of the judiciary and therefore violates the separation-of-powers doctrine. We agree with the State to the extent that the statute requires the district courts to state on the record that they have considered the enumerated factors, but we elect to abide by the legislative mandate and direct the district courts to comply with the statute.
NRS 193.165(1) provides that persons using a deadly weapon in the commission of a crime shall, in addition to the punishment for that crime, be sentenced to a term in prison between 1 and 20 years. In determining the length of the additional penalty, the district court must consider: “(a) [t]he facts and circumstances of the crime; (b) [t]he criminal history of the person; (c) [t]he impact of the crime on any victim; (d) [a]ny mitigating factors presented by the person; and (e) [a]ny other relevant information.” NRS 193.165(1). “The court shall state on the record that it has considered the information described in paragraphs (a) to (e), inclusive, in determining the length of the additional penalty imposed.” Id.
Pursuant to the Nevada Constitution, the legislative, executive, and judicial departments are separate and coequal branches of the state government. Blackjack Bonding v. Las Vegas Mun. Ct., 116 Nev. 1213, 1218, 14 P.3d 1275, 1279 (2000). Accordingly, no branch of government may exercise functions appertaining to either of the others. Nev. Const, art. 3, § 1. With regard to a sentence for a criminal offense, while it is the function of the Legislature to set criminal penalties, Villanueva v. State, 117 Nev. 664, 668, 27 P.3d 443, 445-46 (2001), it is the function of the judiciary to decide what *640penalty, within the range set by the Legislature, if any, to impose on an individual defendant, see Johnson v. State, 118 Nev. 787, 804, 59 P.3d 450, 461 (2002); Sandy v. District Court, 113 Nev. 435, 440, 935 P.2d 1148, 1151 (1997).
The United States Constitution contains substantially similar divisions of power between the legislative, executive, and judicial departments of the federal government. See U.S. Const, art. 1, § 1; id. art. 2, § 1; id. art. 3, § 1; Mistretta v. United States, 488 U.S. 361, 380 (1989) (“ ‘[Ejach of the three general departments of government [must remain] entirely free from the control or coercive influence, direct or indirect, of either of the others.’ ” (second alteration in original) (quoting Humphry’s Executor v. U.S., 295 U.S. 602, 629 (1935))). Although it is within the power of the federal judiciary to impose a sentence in a criminal case, Ex Parte United States, 242 U.S. 27, 42 (1916), the United States Supreme Court has stated unequivocally that it is within the federal legislative power to prescribe mandatory sentences that divest the courts of any discretion in imposing a sentence. Chapman v. United States, 500 U.S. 453, 467 (1991) (“Congress has the power to define criminal punishments without giving the courts any sentencing discretion.”). The Court reasoned that “[a] sentencing scheme providing for ‘individualized sentences rests not on constitutional commands, but on public policy enacted into statutes.’ ” Id. (quoting Lockett v. Ohio, 438 U.S. 586, 605 (1978) (plurality opinion)).
In the instant case, the factors prescribed by NRS 193.165(1) for the district court’s consideration are the result of a public policy determination made by our Legislature. We conclude that, just as it is within the Legislature’s power to completely remove any judicial discretion to determine a criminal penalty by creating mandatory sentencing schemes, it is also within the Legislature’s power to limit judicial discretion by mandating factors to be considered by the courts when imposing a sentence. Other courts have reached the same conclusion. See U.S. v. Kerr, 686 F. Supp. 1174, 1183 (W.D. Pa. 1988) (“[F]rom Congress’ power to eliminate entirely judicial discretion in sentencing follows the power to limit discretion and assign specific values to sentencing factors.”); Carter v. State, 422 N.E.2d 742, 744 (Ind. Ct. App. 1981) (the establishment of a list of factors to be considered when determining sentences “does not invade the power of the judiciary”); Matchett v. State, 941 S.W.2d 922, 932 (Tex. Crim. App. 1996) (stating that it is within the legislative power to establish guidelines for deciding when a sentence of death is appropriate); cf. Fisher v. State, 690 So. 2d 268, 275-76 (Miss. 1996) (holding that a sentencing statute requiring imposition of a death sentence or life imprisonment did not run afoul of the separation of powers doctrine). But see State v. McCoy, 486 P.2d 247, 251-*64152 (Idaho 1971) (holding that courts have an inherent right to suspend a sentence and statute imposing a mandatory sentence, without any right to exercise judicial discretion, is unconstitutional). And, we note that NRS 193.165(1) does not limit the district court’s discretion to consider pertinent facts; instead, paragraph (e) allows the district court to consider “[a]ny other relevant information.” Thus, we conclude that the mandate in NRS 193.165(1) to consider the enumerated factors when determining an appropriate sentence for a deadly weapon enhancement does not run afoul of the separation-of-powers doctrine.3
Conversely, the portion of NRS 193.165(1) which mandates that the district courts state on the record that they have considered the enumerated factors does not implicate the Legislature’s authority to determine the appropriate sentence for a crime. Rather, that portion of the statute “attempts to dictate the actual content of [the court’s] pronouncement of sentence.” People v. Davis, 442 N.E.2d 855, 857 (Ill. 1982). The power to impose a sentence is a basic constitutional function of the judicial branch of government over which this court has inherent authority. Nev. Const, art. 3, § 1; id. art. 6, § 1; see, e.g., Johnson, 118 Nev. at 804, 59 P.3d at 461; Harvey v. Dist. Ct., 117 Nev. 754, 768, 32 P.3d 1263, 1273 (2001) (“[T]he court has inherent and constitutional authority to administer the judicial system.”). Thus, the Legislature is without authority to dictate the manner in which a sentence is pronounced, and that portion of the statute requiring district courts to state on the record that they have considered the enumerated factors intrudes into the judicial function of pronouncing a sentence. Davis, 442 N.E.2d at 857.
Ordinarily, a statute which intrudes on the powers of the judicial branch is construed as directory rather than mandatory. State of Nevada v. American Bankers Ins., 106 Nev. 880, 883, 802 P.2d 1276, 1278 (1990) (“When statutory provisions ‘relate to judicial functions, they should be regarded as directory only.’” (quoting Waite v. Burgess, 69 Nev. 230, 234, 245 P.2d 994, 996 (1952))). However, in this instance, we elect to abide by the legislative mandate contained in NRS 193.165(1) because it serves the laudable goal of ensuring that there is a considered relationship between the circumstances in which the weapon was used — including the defendant’s history — and the length of the enhancement sentence, as opposed to automatically doubling the sentence for the underlying of*642fense, and facilitates appellate review of the enhancement. Therefore, we direct the district courts to make findings regarding each factor enumerated in NRS 193.165(1), as further explained below, when imposing a sentence for a deadly weapon enhancement. We note, however, that such acquiescence should not be construed as an acknowledgment of the Legislature’s authority to enact legislation that impinges on the judicial branch’s authority to dictate how it accomplishes its core functions. See Flynn v. Department of Admin., 576 N.W.2d 245, 255 (Wis. 1998); Judicial Attorneys Ass’n v. State, 586 N.W.2d 894, 899 (Mich. 1998); Mowrer v. Rusk, 618 P.2d 886, 893-94 (N.M. 1980).
Compliance with NRS 193.165(1)
Having concluded that the district courts must fulfill the mandates contained in NRS 193.165(1), we next consider whether the district court did so here. Mendoza-Lobos contends that the district court failed to comply with NRS 193.165(1) when imposing his sentences for the deadly weapon enhancements because it failed to make sufficient findings on the record. In so contending, Mendoza-Lobos necessarily argues that NRS 193.165(1) requires the district court to make findings prior to imposing a sentence for a deadly weapon enhancement. We agree.
The interpretation of a statute presents a question of law and is subject to de novo review. Firestone v. State, 120 Nev. 13, 16, 83 P.3d 279, 281 (2004). This court will attribute the plain meaning to a statute that is not ambiguous. Id. If a statute is ambiguous, however, “the Legislature’s intent is controlling, and we ‘interpret the statute’s language in accordance with reason and public policy.’ ” Sheriff v. Witzenburg, 122 Nev. 1056, 1061, 145 P.3d 1002, 1005 (2006) (quoting Lader v. Warden, 121 Nev. 682, 687, 120 P3d 1164, 1167 (2005)). A statute is ambiguous when its language “lends itself to two or more reasonable interpretations.” State v. Catanio, 120 Nev. 1030, 1033, 102 P.3d 588, 590 (2004). Pursuant to the rule of lenity, criminal statutes are interpreted liberally and any ambiguities or inconsistencies are construed in favor of the defendant. Washington v. State, 117 Nev. 735, 739, 30 P.3d 1134, 1136 (2001).
Mendoza-Lobos asserts that NRS 193.165(1) requires the district court to articulate findings, on the record, as to each factor listed therein. The State contends that the district court is not required to make findings, but merely to state that it has considered the factors set forth in the statute. We conclude that the statute is reasonably subject to either interpretation; thus, we look to its legislative history *643to determine its meaning. See Haney v. State, 124 Nev. 408, 412-13, 185 P.3d 350, 353-54 (2008).
Prior to its amendment in 2007, NRS 193.165(1) mandated that a defendant convicted of using a deadly weapon in the commission of a crime be sentenced to a term equal and consecutive to the sentence imposed for the underlying crime. 1995 Nev. Stat., ch. 455, § 1, at 1431. As amended, the statute still requires that any sentence for a deadly weapon enhancement be consecutive, but it now grants district courts discretion to impose a sentence for a minimum term of not less than 1 year and a maximum term of not more than 20 years in prison, so long as the additional sentence does not exceed the sentence for the underlying crime. NRS 193.165(1), (2). In exercising this discretion, district courts are required to consider five enumerated factors and “state on the record that it has considered” those factors. NRS 193.165(1).
The return to discretionary sentencing was based, in large part, on the need to reduce the prison population. See, e.g., Hearing on A.B. 63 Before the Senate Judiciary Comm., 74th Leg. (Nev., May 10, 2007). However, it appears that legislators were concerned that certain members of the public would feel that discretionary sentencing was arbitrary or unfair. See, e.g., id. Accordingly, during hearings on the proposed amendment, legislators expressed that the purpose of the language requiring district courts to state on the record that they had considered the enumerated factors was to “require[ ] sentencing judges to be more communicative regarding their discretion.” Hearing on A.B. 63 Before the Senate Judiciary Comm., 74th Leg. (Nev., May 31, 2007). Towards this end, it is evident that the Legislature envisioned that the district court would make findings on the record. For example, Senator Mark Amodei stated: “In the context of this bill, when a judge uses discretion, there should be special findings with respect to the context in which the weapon was used.” The Senator went on to assert that “[w]hen a judge sentences a person for using a weapon . . . there should be findings to ascertain why the person received the sentence in the context of whether a weapon was used.’ ’ Hearing on A.B. 63 Before the Senate Judiciary Comm., 74th Leg. (Nev., May 10, 2007). Based on this legislative history, we construe NRS 193.165(1) as requiring district courts to articulate factual findings, on the record, regarding each of the factors enumerated therein.
Further, we conclude that the plain language of the statute requires the district court to make separate findings for each deadly weapon enhancement. NRS 193.165(l)-(3) refer to “the crime,” “the additional penalty,” and “the sentence.” This language indicates that the requirements of the statute must be applied to each crime individually, i.e., that the district court must consider each factor as it *644specifically relates to each enhancement. Moreover, it would be patently unreasonable for a district court to consider the facts and circumstances of only one crime, or the impact on only one of multiple victims, when imposing sentences for multiple counts carrying enhancements.
Having determined that NRS 193.165(1) requires district courts to articulate findings on the record, we must now consider whether the district court articulated sufficient findings in the instant matter. Because Mendoza-Lobos did not object to the sufficiency of the district court’s findings during sentencing, we will grant relief only if he demonstrates plain error. NRS 178.602; Grey v. State, 124 Nev. 110, 123, 178 P.3d 154, 163 (2008); see also Puckett v. United States, 556 U.S. 129 (2009) (holding that plain-error review applies to a claim that the government breached a plea agreement when the defendant failed to object in the district court). Under plain-error analysis, an error that is plain from the record requires reversal if a “defendant demonstrates that the error affected his or her substantial rights, by causing ‘actual prejudice or a miscarriage of justice.’” Valdez v. State, 124 Nev. 1172, 1190, 196 P.3d 465, 477 (2008) (quoting Green v. State, 119 Nev. 542, 545, 80 P.3d 93, 95 (2003)).
Here, although the district court made some findings, it failed to make any findings regarding the facts and circumstances of the robbery and the attempted sexual assault or the context in which the weapon was used in those two crimes, which would be relevant under NRS 193.165(l)(a) and (e). Thus, the district court failed to articulate findings regarding each of the enumerated factors for each deadly weapon enhancement. However, nothing in the record indicates that the district court’s failure to make certain findings on the record had any bearing on the district court’s sentencing decision. Accordingly, the district court’s omission did not cause any prejudice or a miscarriage of justice and thus does not warrant relief.
CONCLUSION
For the reasons discussed above, we affirm the judgment of conviction. In so doing, we conclude that the portion of NRS 193.165(1) requiring the district courts to state on the record that they have considered the factors enumerated in that statute violates the separation-of-powers doctrine. Nevertheless, we instruct the district courts to comply with NRS 193.165(1) in its entirety. We also conclude that compliance with NRS 193.165(1) requires the district courts to articulate findings on the record, for each enumerated factor, when imposing a sentence for a deadly weapon enhancement; if the court is imposing a weapon enhancement *645on multiple counts, separate findings must be made for each enhancement.
Cherry, Saitta, and Gibbons, JJ., concur.The same amendments were made to statutes providing enhancements for: felonies committed on the property of a school (NRS 193.161(1)); felonies committed by adults with the assistance of a child (NRS 193.162(2)); the use of a *637handgun containing metal-penetrating bullets in the commission of a crime (NRS 193.163(1)); felonies committed in violation of a protective order (NRS 193.166(2)); crimes committed against persons over age 60 or vulnerable persons (NRS 193.167(3)); commission of a crime because of certain characteristics of a victim (NRS 193.1675(1)); felonies committed to promote activities of a criminal gang (NRS 193.168(1)); and felonies committed with the intent to commit, cause, aid, further, or conceal an act of terrorism (NRS 193.1685(1)). 2007 Nev. Stat., ch. 525, §§ 10-18, at 3186-93.
Mendoza-Lobos also contends that the district court abused its discretion at sentencing by ordering each sentence to run consecutively. After careful consideration, we conclude that this contention lacks merit. See NRS 176.035(1).
We note that while the Legislature’s power to mandate the consideration of certain fectors at sentencing does not violate the separation-of-powers doctrine, any mandated fectors must still, of course, comport with the other provisions of our constitution. Cf. Glegola v. State, 110 Nev. 344, 348, 871 P.2d 950, 953 (1994) (explaining that the Legislature is empowered to define crimes and set punishments within the limits of the constitution).