
106 Cal.App.3d 685 (1980)
165 Cal. Rptr. 226
THE PEOPLE, Plaintiff and Respondent,
v.
MICHAEL JON ROCCA, Defendant and Appellant.
Docket No. 3697.
Court of Appeals of California, Fifth District.
June 6, 1980.
*687 COUNSEL
Ketchum & Ketchum and Dek Ketchum for Defendant and Appellant.
Evelle J. Younger and George Deukmejian, Attorneys General, Jack R. Winkler, Chief Assistant Attorney General, Arnold O. Overoye, Assistant Attorney General, Robert D. Marshall and Garrett Beaumont, Deputy Attorneys General, for Plaintiff and Respondent.
OPINION
FRANSON, J.
Appellant Michael Jon Rocca was convicted following a jury trial of violating Penal Code section 4533[1] which prohibits a person employed as a guard from aiding or permitting the escape of a prisoner in custody. He was also convicted of violating Penal Code section 261.5 (unlawful sexual intercourse with a minor).
The events giving rise to the convictions involved minors detained in the Tulare County juvenile hall. As we shall explain, Penal Code section 4533 does not apply to the crime of aiding a minor to escape from a juvenile hall because the minor is not a "prisoner" in a jail or prison. For a similar reason, we reject the People's contention that appellant's conviction can be affirmed as a violation of Penal Code section 109[2]*688 which prohibits assisting the escape of any "inmate" of any "public training school or reformatory."
Finally, we reject the argument that appellant's conviction for assisting in the juveniles' attempted escape can be upheld on the theory that he aided and abetted the minors to escape from a juvenile hall, as proscribed by Welfare and Institutions Code section 871[3] since the trial court failed to instruct the jury that a minor, Connie S., who testified against appellant was his accomplice as a matter of law.
We do, however, affirm appellant's conviction of unlawful sexual intercourse with a minor.

FACTS
At the time of the attempted escape, appellant was employed as a supervisor at Glenn Moran Juvenile Hall in Tulare County. One of his duties was to maintain order and observe the detainees' behavior. On the day in question, appellant was assigned to work in the coeducational wing of the facility from 4 p.m. to midnight. He and Josi Rangel were the only two supervisors working in that wing. They were to immediately notify their superior, Phyllis Burk, in the event of an escape attempt. This would be accomplished by sounding a buzzer alarm to alert Ms. Burk.
The bulk of the evidence introduced on the aiding escape count was through testimony of the juveniles who attempted to escape. The detainees involved in the attempt were Lori J., Lee Anna J., Lorna P., Sharon B., Connie S. and, perhaps, Kimberly D.
Connie admitted being a party to the attempt. She testified that appellant helped her and Kimberly plan the escape at about 6 or 7 p.m. The plan was for the girls to lure Supervisor Rangel to one of the girls' rooms by having one of the girls smoke a cigarette. The girls planned to take the keys from Rangel and appellant and then lock the supervisors in separate rooms. The same thing was to be done to Ms. Burk after she was called to the scene. Kimberly was to be locked up with appellant *689 because she did not want to actually escape. Connie testified the actual escape attempt began about 15 minutes after the conversation with appellant.[4]
Ms. Rangel, the cosupervisor, testified that she went to Lee Anna's room at approximately 8:15 p.m. She observed Lee Anna and Lorna smoking cigarettes. She told the girls to extinguish the cigarettes and go to their rooms. They refused. The other girls arrived at the scene. Appellant, who was standing about 40 feet down the hallway, told the girls to "break it up." Appellant and Ms. Rangel were then pushed into different rooms and locked in.
Ms. Rangel and appellant were released by boys in the facility. Ms. Rangel informed her superior, Ms. Burk, of the attempted escape although appellant did not want to report it.
There was also testimony from several other detainees who participated in the attempt, including Lori, Sharon, and Lorna. These witnesses essentially corroborated the testimony of Connie and Ms. Rangel as to how the escape attempt was carried out. However, none of these witnesses testified that appellant participated in planning the escape. Only Connie testified that appellant actually helped in the planning. The other girls merely verified the plan and its implementation without confirming appellant's involvement. However, Sharon did testify that she overheard appellant being asked by either Lee Anna or Lorna if he would help the girls escape. Sharon did not hear appellant's response.
Kimberly testified she told appellant about the planned escape. However, she also testified that she thought the planned escape was a joke and that she told appellant so.
Appellant testified in his own behalf and flatly denied participation in the planning or carrying out of the escape attempt.
As to the unlawful sexual intercourse count, the female involved was Kimberly, a detainee mentioned above. Later in the evening after the escape attempt, appellant went to Kimberly's room two or three times. *690 On the first of these visits, appellant and Kimberly discussed the escape attempt and its consequences.
Appellant left Kimberly's room but returned a short time later. At that time, Kimberly was undressed, wrapped in a sheet. According to Kimberly, she and appellant then engaged in sexual intercourse. Appellant denied this and also denied Kimberly was undressed when he returned to her room to question her a second time about the attempted escape.
One Jose R., a male juvenile, also testified for the prosecution. His testimony at trial was that he couldn't remember anything, but conflicting reports he gave to different investigators were also presented. He told the probation department's investigator that he saw Kimberly in the nude in her room and that appellant was kissing her.
Ms. Rangel testified that she saw appellant leave Kimberly's room and that upon seeing Kimberly some 15 minutes later she (Kimberly) was "dressed" in a sheet. A number of other juveniles also saw appellant enter Kimberly's room.
Afterwards, appellant told Kimberly that Ms. Rangel had probably seen them and that he would probably be fired. The next evening appellant telephoned Ms. Rangel and asked what she was going to put in her report.

DISCUSSION
Penal Code section 4533 provides in relevant part: "Every keeper of a prison, ... or person employed as a guard, who fraudulently contrives, procures, aids, connives at, or voluntarily permits the escape of any prisoner in custody, is punishable by imprisonment in the state prison...." (Italics added.)
By its express language the person prosecuted thereunder must in some manner aid or permit the escape of "any prisoner." For the reasons that follow, we have concluded that a ward of the juvenile court is not a prisoner within the meaning of this section.
Juveniles who are committed to juvenile hall are wards of the court, not persons convicted of a crime, and a proceeding before the juvenile *691 court is not a criminal proceeding. (Welf. & Inst. Code, § 203.)[5] Juvenile halls cannot be connected with any jail or prison and are not to be deemed penal institutions. (Welf. & Inst. Code, § 851.)[6] Juvenile halls are under the control of the county probation officer, not the Youth Authority or the Department of Corrections, although the Youth Authority does make inspections and promulgates minimum standards for the operation and maintenance of juvenile halls. (Welf. & Inst. Code, §§ 852,[7] 209,[8] 210.[9]) An adult person convicted of a felony, unless an alternative disposition is ordered, is sent to prison for punishment. (Pen. Code, § 1170, subds. (a)(1) and (a)(2).) In comparison, juveniles are committed to juvenile hall for instruction, care, guidance and rehabilitation as nearly as possible equivalent to that which should be given by parents. (Welf. & Inst. Code, § 202, subd. (a).)[10] Section 4533 is found in part 3, title 5 of the Penal Code, which is entitled "Offenses Relating to Prisons and Prisoners." Sections 4530 and 4532 are in the same title, chapter and article of the Penal Code as section 4533. Sections 4530 and 4532 penalize escapes or attempted escapes by persons who have been convicted of a crime and are confined to state prisons or similar institutions. Title, chapter and section headings enacted by the Legislature as parts of a code may properly be given weight in construing *692 legislation though they will not control a plain provision in a code section. (People v. Diaz (1978) 22 Cal.3d 712, 717 [150 Cal. Rptr. 471, 586 P.2d 952]; People v. Nichols (1970) 3 Cal.3d 150, 158-159 [89 Cal. Rptr. 721, 474 P.2d 673]; In re Bandmann (1958) 51 Cal.2d 388, 392 [333 P.2d 339]; but see Pen. Code, § 10004.) Construing the title as a whole so as to harmonize all its parts insofar as possible (In re Bandmann, supra, 51 Cal.2d at p. 393; see also People v. Ruster (1976) 16 Cal.3d 690, 696 [129 Cal. Rptr. 153, 548 P.2d 353, 80 A.L.R.3d 1269]), it is logical to conclude that the prisoners spoken of in section 4533 are those defined in sections 4530 and 4532. These definitions exclude juvenile wards.
Moreover, Welfare and Institutions Code section 871, governing escapes from a juvenile hall, was adopted as a part of the Juvenile Court Law long after the adoption of Penal Code sections 4530, 4532 and 4533,[11] and section 871 is a special statute under which juvenile escapees must be prosecuted rather than sections 4530, 4532 or 4533. (See In re Williamson (1954) 43 Cal.2d 651, 654 [276 P.2d 593]; People v. Fiene (1964) 226 Cal. App.2d 305, 308 [37 Cal. Rptr. 925]  the time of passage is a factor to be given consideration though it is not controlling in situations of general versus special statutes.)
Civil cases wherein governmental immunity was at issue which have construed the term "prisoner" to include juvenile wards (see, e.g., Jiminez v. County of Santa Cruz (1974) 42 Cal. App.3d 407, 409-413 [116 Cal. Rptr. 878]) must be confined to the facts, circumstances and issues in those cases and are not controlling in a criminal context. (1) For the foregoing reasons, we hold that a supervisor of a juvenile hall may not be properly prosecuted or convicted for violating Penal Code section 4533. Therefore, appellant's conviction for violating Penal Code section 4533 must be reversed.
The Attorney General contends appellant's conviction for assisting the minors' attempted escape from the juvenile hall can be affirmed under Penal Code section 109 (see fn. 2, ante) on the theory that appellant was given fair notice of the offense prohibited by that section by the charge contained in the information, was given ample time to *693 meet the charge and was accorded a fair trial. The problem with this contention, however, is that appellant's acts do not come within the purview of section 109 any more than they come within the purview of section 4533. Penal Code section 109 makes it a crime to willfully assist "any inmate of any public training school or reformatory to escape, or in an attempt to escape...." That the Legislature intended to equate the term "inmate" with the term "prisoner" when prohibiting escapes from a reformatory or public training school, is demonstrated by the language of Penal Code section 107 (a statute in pari materia with § 109). Penal Code section 107 provides in relevant part: "Every prisoner charged with or convicted of a felony who is an inmate of any public training school or reformatory or county hospital who escapes or attempts to escape from such public training school or reformatory or county hospital is guilty of a felony...." (Italics added.)[12]
The history of the Juvenile Court Law shows the intended scope of both Penal Code sections 107 and 109. In 1909, the California Legislature enacted the original Juvenile Court Law which applied only to children under the age of 18 years not then or thereafter inmates of a state institution. (Stats. 1909, ch. 133, p. 213.) The act provided for the care, custody and maintenance until 21 years of age of dependent and delinquent minor children (see id., § 20, at pp. 222-223); for their commitment to the Whittier State School and the Preston State School of Industry (id., § 5, at p. 216, § 20, at p. 223). The act also imposed upon the legislative body of every county the duty of providing and maintaining, *694 at the expense of the county, a suitable house or place (referred to in the act as a "detention home") for the detention of dependent and delinquent children under the care of the probation officer. It provided that the detention home must not be in or connected with any jail or prison, and "shall be conducted in all respects as nearly like a home as possible and shall not be deemed to be or treated as a penal institution." (Id., § 25, at p. 225, italics added.)
These principles were carried over in the 1915 amendment to the Juvenile Court Law (Stats. 1915, ch. 631, p. 1225 et seq.; see also Welf. & Inst. Code, § 850 and § 851 (added by Stats. 1961, ch. 1616, § 2, p. 3494). In addition to the Whittier State School and the Preston School of Industry, the 1915 act allowed commitment to the California School for Girls and "any other state or county institution." (Id., § 8, at p. 1232.)
As will be seen, we conclude that Penal Code sections 107 and 109, as amended, include within their scope institutions ultimately within the jurisdiction of the Youth Authority.
As a result of the numerous amendments and changes in the relevant statutory law, Penal Code section 109 appears to be an anachronism today. In 1937, the Legislature enacted Welfare and Institutions Code section 1152 which provides "[a]ny person who knowingly permits or aids any inmate of any institution under the jurisdiction of the Youth Authority to escape therefrom, or conceals him with the intent of enabling him to elude pursuit, is guilty of a misdemeanor." (Italics added.) The historical note to section 1152 states that the 1953 amendment to that section substituted the language "any institution under the jurisdiction of the Youth Authority," for "Preston School of Industry, Fred C. Nelles School for Boys, or Ventura School for Girls," and the 1943 amendment substituted "Fred C. Nelles School for Boys" for "Whittier State School." (See Historical Note to § 1152, 73 West's Ann. Welf. & Inst. Code (1972 ed.) p. 364.)
If the scope of Penal Code section 109 is approached from a different point of view, we believe the same conclusion results. Penal Code section 107 refers to persons "convicted of a felony" who are inmates of public training schools or reformatories. As previously noted, Welfare and Institutions Code section 203 provides "[a]n order adjudging a minor to be a ward of the juvenile court shall not be deemed a conviction *695 of a crime for any purpose...." Thus, if prisoners and persons convicted of felonies are confined in public training schools or reformatories, under Welfare and Institutions Code section 851 (which prohibits a juvenile hall from being in or connected with a jail or prison), juveniles could not be detained there. This means that the persons referred to in Penal Code section 109 as "inmate[s]" would have to be adults, i.e., individuals over 18 or those under 18 found to be unfit for juvenile court process.
Although Welfare and Institutions Code section 871 covers escapes by a juvenile from a juvenile hall (a misdemeanor), the Legislature apparently failed to enact a specific statute covering the crime of assisting a juvenile to escape from a juvenile hall. Nevertheless, the legislative hiatus is easily filled by the fact that one who assists a juvenile to escape from a juvenile hall is guilty of aiding and abetting the juvenile in a violation of Welfare and Institutions Code section 871. Penal Code section 31 which defines "principals" to a crime includes those who "aid and abet" in the commission of the act constituting the offense. Under this broad concept, a defendant may be guilty of a crime which he himself could not possibly commit, such as the defendant in the present case insofar as a violation of Welfare and Institutions Code section 871 is concerned. (See cases in 1 Witkin, Cal. Crimes (1963 ed.) § 44, pp. 46-47; 17 Cal.Jur.3d, Criminal Law, § 93, pp. 150-152.)
(2) In summary, we hold that Penal Code section 109 was intended to govern persons who assist escapes by prisoner-inmates of state schools or reformatories (but see Welf. & Inst. Code, § 1152) and is not applicable to a person who aids an escape attempt by juveniles in a local detention facility under the control of the county probation officer. Just as a juvenile is not a "prisoner" within the contemplation of Penal Code section 4533, it necessarily follows that a juvenile detained in a juvenile hall is not an "inmate" of a public training school or reformatory, as provided in Penal Code section 109 (which must be read in conjunction with Pen. Code, § 107).
The Attorney General next argues that we should uphold appellant's conviction on the theory that appellant aided and abetted the minors' attempted escape from the juvenile hall in violation of Welfare and Institutions Code section 871. (3) While it may be true that appellant was given fair notice of this offense and had ample time to meet the charge, we cannot affirm a conviction on this theory because the trial *696 court failed to instruct the jury that Connie was appellant's accomplice as a matter of law.[13] An accomplice is a person who is liable to prosecution for the identical offense charged against the defendant; i.e., he could be charged as a principal for the crime which the defendant is accused of committing (Pen. Code, § 1111). The definition of "accomplice" includes anyone who aids or abets the commission of the crime at issue. (People v. Bohmer (1975) 46 Cal. App.3d 185, 192 [120 Cal. Rptr. 136]; People v. Gordon (1973) 10 Cal.3d 460, 468 [110 Cal. Rptr. 906, 516 P.2d 298].) It is clear Connie could have been charged with the offense of aiding and abetting the other minors' escape attempt from the juvenile hall. According to Connie's testimony, she and appellant worked together and planned this very crime. There was no conflict in the evidence on that point. Appellant's testimony did not create a conflict because he was not disputing Connie's role, but his own (People v. Hoover (1974) 12 Cal.3d 875, 880-881 [117 Cal. Rptr. 672, 528 P.2d 760]).
The purpose of the accomplice requirement set forth in Penal Code section 1111 is to prevent convictions based solely on evidence from inherently untrustworthy sources (People v. Belton (1979) 23 Cal.3d 516, 525 [153 Cal. Rptr. 195, 591 P.2d 485]). Connie was the only witness who testified that appellant helped plan the escape. She had a strong motive to lessen her degree of responsibility in the escape attempt by implicating appellant. (See People v. Gordon, supra, 10 Cal.3d at p. 468.) Since the evidence against appellant apart from Connie's testimony was quite weak, we conclude it is reasonably probable that appellant would not have been convicted of aiding and abetting the violation of Welfare and Institutions Code section 871 if the jury had been properly instructed on the law pertaining to Connie's status as an accomplice (People v. Watson (1956) 46 Cal.2d 818, 836 [299 P.2d 243]).
We turn now to appellant's conviction of unlawful sexual intercourse with a female under the age of 18. Appellant contends that the evidence is insufficient to support the jury's verdict. (4) Kimberly described in detail the act of sexual intercourse in which she engaged with appellant *697 who knew she was under 18. Clearly, her testimony constitutes substantial evidence (People v. Redmond (1969) 71 Cal.2d 745, 755 [79 Cal. Rptr. 529, 457 P.2d 321]).
The judgment is reversed insofar as appellant's conviction of violating Penal Code section 4533. The judgment is affirmed insofar as the conviction of violating Penal Code section 261.5, a misdemeanor.
Brown (G.A.), P.J., and Condley, J.,[*] concurred.
A petition for a rehearing was denied June 26, 1980.
NOTES
[1]  Penal Code section 4533 reads: "Every keeper of a prison, sheriff, deputy sheriff, constable, or jailor, or person employed as a guard, who fraudulently contrives, procures, aids, connives at, or voluntarily permits the escape of any prisoner in custody, is punishable by imprisonment in the state prison, and fine not exceeding ten thousand dollars ($10,000)."
[2]  Penal Code section 109 reads: "Any person who willfully assists any inmate of any public training school or reformatory to escape, or in an attempt to escape from such public training school or reformatory is punishable by imprisonment in the state prison, and fine not exceeding ten thousand dollars ($10,000)."
[3]  Welfare and Institutions Code section 871 reads: "Any person under the custody of a probation officer in a county juvenile hall, or committed to a county juvenile home, ranch, camp, or forestry camp, who escapes or attempts to escape from such county juvenile hall, home, ranch, camp, or forestry camp, is guilty of a misdemeanor."
[4]  Part of Connie's testimony from the preliminary hearing was also read into the record. In that testimony Connie stated she did not speak with appellant about how to escape until the escape was actually in progress.
[5]  Welfare and Institutions Code section 203 provides: "An order adjudging a minor to be a ward of the juvenile court shall not be deemed a conviction of a crime for any purpose, nor shall a proceeding in the juvenile court be deemed a criminal proceeding."
[6]  Welfare and Institutions Code section 851 provides: "The juvenile hall shall not be in, or connected with, any jail or prison, and shall not be deemed to be nor be treated as a penal institution. It shall be conducted in all respects as nearly like a home as possible."
[7]  Welfare and Institutions Code section 852 provides: "The juvenile hall shall be under the management and control of the probation officer."
[8]  Welfare and Institutions Code section 209 provides in pertinent part: "The Department of the Youth Authority shall likewise conduct an annual inspection of each jail, juvenile hall, or lockup situated in this state which, during the preceding calendar year, was used for confinement for more than 24 hours of any minor."
[9]  Welfare and Institutions Code section 210 provides: "The Youth Authority shall adopt minimum standards for the operation and maintenance of juvenile halls for the confinement of minors."
[10]  Welfare and Institutions Code section 202, subdivision (a), provides: "(a) The purpose of this chapter is to secure for each minor under the jurisdiction of the juvenile court such care and guidance, preferably in his own home, as will serve the spiritual, emotional, mental, and physical welfare of the minor and the best interests of the state; to protect the public from criminal conduct by minors; to impose on the minor a sense of responsibility for his own acts; to preserve and strengthen the minor's family ties whenever possible, removing him from the custody of his parents only when necessary for his welfare or for the safety and protection of the public; and, when the minor is removed from his own family, to secure for him custody, care, and discipline as nearly as possible equivalent to that which should have been given by his parents. This chapter shall be liberally construed to carry out these purposes."
[11]  Although Penal Code sections 4530, 4532 and 4533 were enacted in 1941, these statutes are essentially recodifications of former Penal Code sections 105, 107 and 108, which were enacted in 1872, 1872 and 1850, respectively. (See Historical Notes to §§ 4530, 4532, 4533, 51A West's Ann. Pen. Code (1970 ed.) pp. 365, 374, 380.)
[12]  The legislative history of Penal Code section 107 reflects that "inmate" was intended to mean a "prisoner" detained in a jail or institution other than state prison. As enacted in 1872, section 107 read: "Every prisoner confined in any other prison than the State Prison, who escapes or attempts to escape therefrom, is guilty of a misdemeanor." (Italics added.)

The 1923 amendment to section 107 rewrote the section to read: "Every prisoner charged with or convicted of a felony who is confined in any jail or prison or an inmate of any public training school or reformatory or county hospital, or who is engaged on any county road or other county work or who is in the lawful custody of any officer or person, who escapes or attempts to escape from such jail, prison, public training school, reformatory or county hospital, or from the custody of the officer or person in charge of him..., is guilty of a felony and is punishable as provided in section 108 of the Penal Code." (Italics added.)
The 1935 amendment extended the coverage of the section to inmates of an industrial farm or industrial roadcamp.
The 1941 amendment deleted references to confinement in jail or prison, to industrial farms or industrial roadcamps, to engagement on any county road or other county work or to lawful custody of an officer or person. The deleted provisions were incorporated into the then new Penal Code section 4532. (See Historical Note to § 107, 47 West's Ann. Pen. Code (1970 ed.) p. 221.)
[13]  The jury was instructed that appellant had the burden of proving the minors were his accomplices. While this was an appropriate instruction as to Kimberly, Sharon, Lorna and Lee Anna, it clearly was incorrect as to Connie because the evidence with respect to her participation and cooperation with appellant in the escape attempt is clear and undisputed. (Cf. People v. Cisneros (1973) 34 Cal. App.3d 399, 414 [110 Cal. Rptr. 269].)
[*]   Assigned by the Chairperson of the Judicial Council.
