The sole issue in this case is whether pursuant to G. L. c. 127, § 49, consecutive sentences are to be aggregated for purposes of forfeiting statutory good conduct credits when an inmate escapes from work release. Section 49 reads in pertinent part as follows: “[A]ll deductions from the sentence or sentences [the inmate] was serving at the time of such escape, authorized by [G. L. c. 127, § 1291] shall be forfeited.” The Department of Corrections (department) construes this statute to mean that consecutive sentences shall be combined into one sentence from which the prisoner’s accumulated statu*252tory good conduct credits shall be deducted. Based on this interpretation, upon the petitioner’s conviction on the charge of escape from work release, the department combined his two consecutive sentences —■ the first, for assault and battery by means of a dangerous weapon, and the second, for rape — into one sentence from which the department mandated forfeiture of all the petitioner’s accumulated statutory good conduct credits to arrive at a maximum release date. The petitioner contends that this was error, for the department should have deducted his good conduct credits only from the one sentence he was serving at the time of his escape, the sentence for rape, for which there were no statutory good time credits to deduct. See G. L. c. 127, § 129. Claiming that he was entitled to his immediate release from prison, the petitioner filed a petition for a writ of habeas corpus in the Superior Court, which was denied. We affirm.
We summarize the material facts which are not contested. Effective February 3, 1972, the petitioner began serving a six to ten year sentence for assault and battery by means of a dangerous weapon. At the commencement of that sentence, the petitioner was awarded 1,500 days of statutory good conduct credits under G. L. c. 127, § 129. See Burno v. Commissioner of Correction, 399 Mass. 111, 114 (1987). On November 26, 1975, the petitioner was sentenced to a term of from fifteen to twenty years for the crime of rape. This sentence was to run from and after the expiration of the sentence he was presently serving. As noted, the petitioner was not entitled to any statutory good conduct credits for his rape conviction. G. L. c. 127, § 129. On or about December 10, 1985, the petitioner escaped from a work release program at the Massachusetts Correctional Institution at Shirley. He was at large until May 15, 1987. On December 21, 1987, following the conviction of escape, the petitioner was sentenced to three to five years in State prison, which sentence was to run concurrently with the sentence he was then serving. After the imposition of this sentence, the department authorized forfeiture of all the petitioner’s accrued statutory good conduct credits of 1,500 days on his conviction for assault and battery by means of a dangerous weapon and recalculated his maximum release date as August 30, 2000. If the department had not authorized forfeiture of the petitioner’s statutory good conduct credits on this conviction, he would have been entitled to a release date in August, 1996.
We now turn to the construction of § 49. At the outset, we *253look to the words of the statute. Moloney v. Boston Five Cents Sav. Bank FSB, 422 Mass. 431, 433 (1996). The petitioner argues that the words at issue, “the sentence or sentences he was serving at the time of [his] escape,” must be interpreted to mean the sentence for rape because his six to ten year sentence for his assault and battery conviction had long since been served. He bases his argument on the grounds that § 49 is a penal statute, see Wood v. Commissioner of Correction, 363 Mass. 79, 81 (1973), and any ambiguity in its meaning must be resolved in his favor. He asserts that the words, “at the time of [the] escape,” under their common and approved usage, have a temporal meaning which suggests that the Legislature intended the section to apply only to the sentence presently being served and not a combination of all of his sentences upon which he was committed. While we agree with the petitioner that penal statutes should be strictly construed, this principle does not require that a penal statute be construed in such a manner so as to defeat the obvious intention of the Legislature. Ibid.
In ascertaining the Legislature’s intent, we look not only at the Legislature’s words, but also the “cause of [the statute’s] enactment, the mischief or imperfection to be remedied and the main object to be accomplished.” Commonwealth v. Galvin, 388 Mass. 326, 328 (1983), quoting from Board of Educ. v. Assessor of Worcester, 368 Mass. 511, 513 (1975). The text of § 49 in question was added by St. 1972, c. 777, § 13. At the time of its enactment a similar penalty provision was in effect for escapes from prison camps. G. L. c. 127, § 83B. As in the case of § 83B, we presume it was the intent of the Legislature to impose a mandatory penalty to deter prisoners from escaping in circumstances presenting the opportunity for doing so. Wood v. Commissioner of Correction, 363 Mass, at 83. Were we to adopt the construction being urged by the petitioner, there would be no such deterrent for a prisoner who was serving a sentence which was not entitled to any good conduct credits. Similarly, without a discernible reason, a prisoner serving a single sentence in most cases would suffer a greater penalty than those prisoners sentenced for the same total period but under consecutive sentences. In comparison, the department’s construction would insure that all prisoners would be exposed to an additional penalty upon their escape commensurate with the legislative purpose and achieve greater parity in treatment of prisoners similarly situated.
*254We are also aided in our interpretation of § 49 by the canon of statutory construction which provides that different sections of the same statute which relate to the same subject matter should be construed together so as to constitute a harmonious whole consistent with the legislative purpose. See McNeil v. Commissioner of Correction, 417 Mass. 818, 822 (1994). Section 129 sets out the method for reducing the sentences of prisoners by reason of their good conduct credits. In Diafario v. Commissioner of Correction, 371 Mass. 545, 547 (1976), the court was asked to determine how a reduction under § 129 should be applied when a prisoner is serving two consecutive sentences. Like the petitioner in this case, the prisoner in Diafario was serving two consecutive sentences and was entitled to good conduct credits on only the first of his two sentences. Id. at 548-549. The prisoner in that case also argued that consecutive sentences should be treated separately in deducting good conduct credits. Id. at 550. The court rejected that argument, and held that, in arriving at a release date, consecutive sentences are to be aggregated for purposes of fixing a single termination date from which the total statutory good conduct credits are to be deducted, even though one of the sentences is not entitled to statutory good conduct credits. Id. at 550-552. In order to achieve internal consistency between § 49 and § 129, the department urges us to treat consecutive sentences similarly in applying the forfeiture provisions of § 49.
The petitioner asserts that we should reject that approach because the language in § 129, on which the court relied in the Diafario case, is not identical to the language used by the Legislature in § 49. Specifically the petitioner points to that provision in § 129 which reads, “[i]f a prisoner has two or more sentences to be served concurrently or otherwise, the maximum period of time for which he may be held under his sentences shall be the basis upon which the deduction shall be determined” (emphasis supplied). The lack of identical language does not necessarily prove varying intent. Goodwin v. Department of Pub. Util., 351 Mass. 25, 27 (1966). Instead, we are persuaded that the better course is to read the sections together so as to constitute a harmonious and consistent body of law. Johnson v. Johnson, 425 Mass. 693, 696 (1997). Cf. Wood v. Commissioner of Correction, 363 Mass, at 82 n.5.
Accordingly, we decide that the sentence or sentences the petitioner was serving at the time of his escape, for the purpose *255of applying the forfeiture of good conduct credits pursuant to § 49, was an aggregate of his sentence for assault and battery by means of a dangerous weapon and his sentence for rape.2 Such a construction not only promotes parity in treatment among prisoners but also best achieves the purpose of the statute without enlarging its meaning by implication.
Order denying petition affirmed.
General Laws c. 127, § 129, was repealed by St. 1993, c. 432, § 10, effective July 1, 1994. We review the petitioner’s appeal because his action was brought while § 129 was still in effect. See Cordeiro v. Commissioner of Correction, 37 Mass. App. Ct. 690, 693 n.6 (1994).
We decline to review the petitioner’s argument that he is entitled to a pro rata forfeiture of his good time credits since he did not raise this issue in Superior Court. See Commonwealth v. Marchionda, 385 Mass. 238, 242 (1982).