The defendant was convicted by a jury in the *184Superior Court of unlawful possession of crack cocaine with intent to distribute, G. L. c. 94C, § 32A (c); unlawful possession of a firearm while in the commission of a felony, G. L. c. 265, § 18B; unlawful possession of a firearm, G. L. c. 269, § 10 (Zz); unlawful possession of ammunition, G. L. c. 269, § 10 (Zz); and unlawful possession of marijuana, G. L. c. 94C, § 34.1 The case, which we transferred here on our own motion, involves cross appeals. The defendant’s appeal challenges the sufficiency of the Commonwealth’s evidence supporting his conviction of unlawful possession of a firearm while in the commission of a felony. He contends that his possession of a loaded .40 caliber Smith and Wesson handgun in a locked safe in the bedroom of his apartment, where a quantity of unlawful drugs and the key to the safe were found, does not, as matter of law, constitute the unlawful possession of a firearm “in the commission of a felony” (the felony being the unlawful possession of cocaine with intent to distribute) within the meaning of G. L. c. 265, § 18B. The Commonwealth cross-appeals from the denial of its motion to correct the defendant’s sentence. On his conviction under G. L. c. 265, § 18B (first offense), the judge sentenced the defendant to five years’ probation (on and after the sentence imposed on the conviction of unlawful possession of crack cocaine with intent to distribute). The Commonwealth contends that the statute prohibits the imposition of probation and requires a mandatory minimum prison sentence of five years. We conclude that the defendant’s conviction under G. L. c. 265, § 18B, was permitted under the statute and was supported by sufficient evidence. We further conclude that the judge improperly denied the Commonwealth’s motion to correct the defendant’s sentence, and we vacate the sentence.
Based on the Commonwealth’s evidence, considered under the standard set forth in Commonwealth v. Latimore, 378 Mass. 671, 676-677 (1979), the jury could have found the following facts. On February 23, 2004, Springfield police officers, while responding to a report of an armed assault in the vicinity of the defendant’s apartment, a high crime area, observed a man (not *185the defendant) leave the defendant’s apartment through the back door, catch sight of the officers, and then retreat back into the apartment. The man appeared to resemble the description given of the shooter in the armed assault, so Officer Charles Howard and another officer knocked on the door to the defendant’s apartment. A minute or two later, the defendant answered the door. The defendant stated that he lived in the apartment, and that he was “just chilln’ ” with his friends. The officers asked if they could enter and see the defendant’s friends. The defendant agreed.
On entering, the officers smelled an odor of burnt marijuana. The defendant called to his friends, who were in a different room. As the two friends approached, including the man previously seen, the officers met them in the hallway and frisked them for weapons, discovering none. From where he was standing, Officer Howard could see into an adjacent bedroom. On top of a dresser in the bedroom, Officer Howard saw a sandwich bag containing a green leafy substance that he suspected to be marijuana. He went into the bedroom to confirm his suspicion, and then noticed, next to the marijuana, a clear bag containing fifteen small rocks of crack cocaine, individually packaged. Officer Howard seized the marijuana and the crack cocaine.2
More officers arrived at the scene. The defendant was read his Miranda rights, and he signed a Miranda waiver form as well as a form consenting to a further search of his apartment. The officers seized thirty-four individually wrapped small pieces of crack cocaine in a dresser drawer in the bedroom, along with $76 cash in denominations consistent with drug dealing. In a small night stand next to the bed, Officer Howard discovered a locked safe. Officer Timothy Morrow saw a jacket hanging on the bedroom door, and found a set of keys in one of the pockets. The defendant admitted that the jacket and the keys belonged to him. One of the keys had the word “Century” on it, which corresponded with a label on the safe. Officer Morrow used the key to unlock the safe. Inside, the police found a loaded firearm, a .40 caliber Smith and Wesson handgun; $1,100; a Movado *186watch; and personal papers of the defendant, including his lease to the apartment and the results of a paternity test.
An expert witness for the Commonwealth explained how crack cocaine is packaged for distribution. He testified that the individually packaged pieces of crack cocaine seized from the defendant’s apartment are sold “in what are called dimes, which are ten dollar pieces.” He expressed his opinion that the crack cocaine seized from the defendant’s apartment was not consistent with personal use, but rather with distribution.
The defendant testified. He stated that the police forcibly entered his apartment without his consent, threatened him at various times while inside, and searched the apartment before they obtained his consent, which he had not willingly provided.3 The defendant maintained that the safe belonged to his neighbor who had been in an argument with his girl friend and had asked the defendant to hold some of his personal property, including both the safe and its key. The defendant claimed that his lease and paternity test results had been in the top drawer of his dresser, not in the safe. Because many of his friends had access to his apartment, the defendant indicated that the owner of the crack cocaine, money, and handgun found inside his apartment was uncertain. The defendant admitted that the marijuana belonged to him.
One of the defendant’s friends, Dahu Joseph, who had been in the apartment that evening, also testified. Joseph stated that when he first encountered the police that evening, they grabbed him and his cousin and threw them against the wall. Before the police arrived, Joseph noticed that the defendant’s dresser had nothing on it.
At the close of the Commonwealth’s evidence, and again at the close of all the evidence, the defendant moved under Mass. R. Crim. R 25 (a), 378 Mass. 896 (1979), for required findings of not guilty. No ground was specified by the defendant for the motions, and both were denied by the judge. The defendant’s convictions and sentencing ensued. The Commonwealth moved to correct the sentence, and the judge denied the motion. These cross appeals followed.
*1871. The substantive portion of G. L. c. 265, § 18B, reads, in pertinent part, as follows:
“Whoever, while in the commission of or the attempted commission of an offense which may be punished by imprisonment in the state prison, has in his possession or under his control a firearm, rifle or shotgun shall, in additian to the penalty for such offense, be punished by imprisonment in the state prison for not less than five years . . (emphasis added).
Prior to its amendment, see St. 1998, c. 180, § 56, the statute punished a defendant who, “while committing [a felony,] uses a firearm, rifle, shotgun or machine gun” (emphasis added). G. L. c. 265, § 18B, as amended by St. 1984, c. 189, § 162. This statutory provision was similar to a prior version of a corresponding Federal statute, 18 U.S.C. § 924(c)(1) (1988), which punished a defendant who “during and in relation to any crime of violence or drug trafficking crime . . . uses or carries a firearm.” Bailey v. United States, 516 U.S. 137, 138 (1995), quoting 18 U.S.C. § 924(c)(1). In the Bailey decision, the United States Supreme Court held that, to obtain a conviction under the Federal statute, a defendant actively had to use the firearm diking the predicate offense, namely “a use that makes the firearm an operative factor in relation to the predicate offense.” Id. at 143. Congress responded to the Bailey decision by amending the Federal statute in 1998, to broaden the offending conduct to punish a defendant “who, during and in relation to any crime of violence or drug trafficking crime ... in furtherance of any such crime, possesses a firearm . . . .” See United States v. Grace, 367 F.3d 29, 34-35 (1st Cir. 2004), quoting Pub. L. 105-386, 112 Stat. 3469 (1998) (codified at 18 U.S.C. § 924[c][l][A]). See also United States v. Lawrence, 308 F.3d 623, 629 (6th Cir. 2002) (explaining response of Congress to Bailey decision). The Legislature followed suit, and rewrote G. L. c. 265, § 18B, in 1998 to remove its prior “use” language and to replace the words indicating operative use with the language in the current statute. See St. 1998, c. 180, § 56.
The defendant argues, in various articulations, that the current statute cannot apply to his conduct because the statute ap*188plies only to a defendant who actually “uses” a firearm “while in the commission or attempted commission” of a predicate felony. The essence of the defendant’s argument is that an insufficient nexus exists between the firearm and his unlawful possession of drugs with intent to distribute them. The prerequisite nexus is absent, he says, because the statute requires for conviction possession of, or control over, a firearm during the active commission of a felony, and it is inapplicable to facts like those here where a defendant possesses contraband passively with an intent to do something illegal with it at some future time. We reject these contentions.
The Legislature could have limited the reach of G. L. c. 265, § 18B, by applying it to only certain underlying felonies, such as the actual distribution of drugs. The Legislature’s intent not to limit the statute so derives from its broad application to any felony. See G. L. c. 265, § 18B (applying to “the commission of . . .an offense which may be punished by imprisonment in the state prison”).
The literal language of the statute applies to the facts that could have been found by the jury — the defendant possessed, and had control over, a handgun while committing a felony. The jury were free to (and undoubtedly did) reject the defendant’s testimony that the handgun found in the safe in his bedroom was not his. The “commission” element consists of the unlawful possession of the defendant’s large cache of forty-nine individually wrapped pieces of crack cocaine with, as the jury could find, based on the packaging and quantity of the crack cocaine, the intent to distribute them. See Commonwealth v. Clermy, 421 Mass. 325, 327, 331 (1995). The defendant’s argument that no nexus existed between the firearm and the underlying felony is refuted by the Commonwealth’s evidence. The jury were warranted in finding that the defendant had a readily accessible, loaded .40 caliber Smith and Wesson handgun (that he was not licensed to carry) so he could protect his forty-nine individually packaged pieces of crack cocaine (which were just feet away from the handgun in the same room) and his drug proceeds (of which a large amount [$1,100] was found alongside the handgun and a much smaller amount [$76] was found inside a dresser drawer alongside some of the crack cocaine) when, *189and if, he had notice that the contraband, and his safety in conducting the criminal enterprise, were threatened.
This conclusion is supported in a number of ways other than the literal application of the statutory language. First, it can reasonably be said that our Legislature, like Congress, wanted to address the result of the Bailey decision. Cf. United States v. Lawrence, supra. The Legislature undoubtedly recognized that drug offenses frequently involve drug dealers being armed and that, in many cases, shootings and killings occur when a drug dealer is confronted by police, when a drug deal goes “bad,” or when others try to steal the drugs. Our interpretation of the statute comports with the Legislature’s obvious intention to “punish the underlying felonies more severely where a firearm is involved.” Commonwealth v. Hawkins, 21 Mass. App. Ct. 766, 769 (1986).
We take note that Federal decisions construing the amended Federal statute have set out certain pragmatic factors for courts to use in evaluating whether a sufficient nexus exists between the defendant’s possession of, or control over, the firearm and the predicate felony. See United States v. Gaston, 357 F.3d 77, 83 (D.C. Cir.), cert. denied, 541 U.S. 1091 (2004), and cases cited. The factors are nonexclusive and include “whether the gun was loaded, the type of weapon, the legality of its possession, the type of drug activity conducted, and the time and circumstances under which the firearm was found.” Id., quoting United States v. Wahl, 290 F.3d 370, 376 (D.C. Cir. 2002). Federal courts applying these factors in comparable circumstances have come to conclusions like the one we reach. See, e.g., United States v. Stevens, 380 F.3d 1021, 1027 (7th Cir. 2004) (adequate nexus where guns had been found in same room with drugs and drug paraphernalia, guns were easily accessible, one weapon was loaded, and extra ammunition was found in same drawer as eighty-two individually packaged bags of crack); United States v. Grace, supra at 31, 36 (sufficient nexus where unloaded firearm had been found in plastic bag in drawer under bed, and drug supply and proceeds were in computer room, which was only separated from bedroom by curtain); United States v. Gaston, supra at 82-83 (sufficient nexus found where loaded guns were illegally possessed and were found in same room as forty small *190bags of heroin and large amount of cash). These pragmatic factors furnish a useful guide and, as illustrated above, several of the factors apply to this case.
The statute, admittedly, sweeps in a broad range, speaking generally of any felony combined with the possession of, or control over, a firearm. Some nexus between the felony and the firearm in terms of proximity, and logical relation to the nature of the felony itself, must ordinarily exist before conviction can result. The existence of the requisite nexus necessarily will be determined on a case-by-case basis. We are satisfied that the nexus is present here and, as a consequence, that the jury’s verdict was proper.
2. We conclude that the judge’s sentence of five years’ probation on the defendant’s first offense conviction under G. L. c. 265, § 18B, must be vacated. The relevant portions of the statute provide:
“Whoever, while in the commission of [a felony], has in his possession or under his control a firearm, rifle or shotgun shall, in addition to the penalty for such offense, be punished by imprisonment in the state prison for not less than five years ....
“A sentence imposed under this section for a second or subsequent offense shall not be reduced nor suspended, nor shall any person convicted under this section be eligible for probation, parole, furlough or work release or receive any deduction from his sentence for good conduct until he shall have served the minimum term of such additional sentence .... Prosecutions commenced under this section shall neither be continued without a finding nor placed on file. The provisions of [G. L. c. 276, § 87,] relative to the power of the court to place certain offenders on probation shall not apply to any person 17 years of age or over charged with a violation of this section.”
We agree with the Commonwealth that the statute prohibits the disposition of probation. The language in the first sentence of the second paragraph, “nor shall any person convicted under this section be eligible for probation,” does not, as the defendant suggests, address only second or subsequent offenders. By using *191the words “this section,” the prohibition against the imposition of probation applies to the entire statutory provision, which includes both paragraphs. While the prohibition on probation could have been better situated, its placement creates no material ambiguity that might benefit the defendant.
The absence of the word “mandatory” in the relevant language in the first paragraph of § 18B (offender “shall . . . be punished [in the State prison] for not less than five years”) leads us to reject the Commonwealth’s contention that the statute requires a mandatory minimum State prison sentence of five years. See Commonwealth v. Lightfoot, 391 Mass. 718, 718 n.1, 721 (1984) (explaining that statutory imperative that judge “shall” impose a State prison term “for a period of five years” does not, in absence of word “mandatory,” preclude judicial discretion in sentencing). See also Commonwealth v. Marrone, 387 Mass. 702, 704-705 (1982) (refusing to interpret word “mandatory” in G. L. c. 94C, § 32E [c] [3], inserted by St. 1980, c. 436, § 4, that set forth “a mandatory term of fifteen years in the state prison,” as meaning “mandatory minimum”).4 By imposing a State prison sentence, the Legislature provided that a violation of G. L. c. 265, § 18B, would constitute a felony. When resentencing the defendant, the judge should “fix *192a maximum and a minimum term” in accordance with G. L. c. 279, § 24.5
3. We affirm the defendant’s conviction under G. L. c. 265, § 18B. The sentence on that conviction is vacated, and the case is remanded for resentencing consistent with this opinion.
So ordered.
The unlawful possession of marijuana conviction was filed with the defendant’s consent and is not before us. See Commonwealth v. Delgado, 367 Mass. 432, 438 (1975).
Testing of the drugs confirmed that the substances were in fact marijuana and crack cocaine.
The defendant filed a pretrial motion to suppress the evidence essentially on these same grounds. The trial judge denied the motion.
We reject the Commonwealth’s argument that Commonwealth v. Brown, 431 Mass. 772 (2000), and Commonwealth v. Berte, 57 Mass. App. Ct. 29 (2003), are dispositive. Those cases dealt with the penalty provisions in earlier versions of the home invasion statute, G. L. c. 265, § 18C. Contrary to the Commonwealth’s contention, the language at issue in those cases is not “essentially the same” as the language at issue in this case. See Commonwealth v. Brown, supra at 772 n.1 (construing portion of G. L. c. 265, § 18C, inserted by St. 1993, c. 333, that stated that offender “shall be punished by imprisonment in the state prison for life or for any term of not less than twenty years” [emphasis added]); Commonwealth v. Berte, supra at 30 n.2 (construing portian of G. L. c. 265, § 18C, as amended by St. 1998, c. 180, § 57, that provided: “Whoever commits said crime while being armed . . . shall be punished by imprisonment in the state prison for 20 years. Said sentence shall not be reduced to less than ten years nor shall the person convicted be eligible for probation, parole, furlough, work release or receive any deduction from his sentence for good conduct”). In contrast to the language at issue here, the language at issue in Commonwealth v. Brown, supra, dealt with two terms, both a maximum and a minimum term. Unlike the language in Commonwealth v. Berte, supra, stating that the twenty-year sentence cannot be reduced to less then ten years, no such language immediately follows the “for not less than five years” language in G. L. c. 265, § 18B.
General Laws c. 279, § 24, provides: “If a convict is sentenced to the state prison, except for life or as an habitual criminal, the court shall not fix the term of imprisonment, but shall fix a maximum and a minimum term for which he may be imprisoned. The maximum term shall not be longer than the longest term fixed by law for the punishment of the crime of which he has befen] convicted, and the minimum term shall be a term set by the court, except that, where an alternative sentence to a house of correction is permitted for the offense, a minimum state prison term may not be less than one year.”