
331 S.E.2d 503 (1985)
STATE of West Virginia
v.
ELLSWORTH J.R.
No. 16350.
Supreme Court of Appeals of West Virginia.
Submitted January 29, 1985.
Decided June 6, 1985.
*505 Arthur A. King, Public Defender Corp., Martinsburg, for appellant.
Janet Frye Steele, Asst. Atty. Gen., Charleston, for appellee.
*504 MILLER, Justice:
This is a direct statutory appeal by Ellsworth J.R., a juvenile,[1] from an order of the Circuit Court of Berkeley County transferring him to adult criminal jurisdiction upon a finding of probable cause to believe he had committed murder, one of the permissible transfer offenses enumerated in W.Va. Code, 49-5-1(d)(1).
The principal assignment of error relates to the validity of the juvenile's confession which was taken on February 7, 1984, when he was seventeen years of age, while he was in custody and without counsel or relatives present.
The circumstances surrounding the confession are that the police, who had previously talked to the juvenile on two occasions, knew that he was present when the victim fell into a quarry and drowned in its accumulated water. The juvenile had accompanied the victim, his wife, and their children to a picnic which was held a short distance from the edge of the quarry. After they had eaten, the wife suggested to her husband that he dump the hot coals from the grill into the quarry. In the process of doing this, he allegedly fell over into the quarry.
Subsequent police investigation had revealed that the victim's sister-in-law changed her testimony and stated that the victim's wife had remarked that the juvenile had told her he had pushed the victim over the edge. Based partly upon this information, the police again approached the juvenile who was staying with a friend and asked him if he would accompany them to the police station. The juvenile responded, "no problem," and got into the cruiser and was given his Miranda warnings.
The police stated to the juvenile that they had information which led them to believe that he had been paid $2,000 to push the victim into the quarry. They also indicated that they were aware that he had bought a car with part of the money. At this point, the juvenile admitted that he had been lying and stated that he had pushed the victim into the quarry.
Upon the arrival at the police barracks a short time later, he was again read his Miranda warnings and gave a seven-page written statement. He was taken before a magistrate within two and one-half hours after he was initially picked up by the police.
Two arguments are made challenging the admissibility of the confessions.[2] First, the juvenile contends that under State ex rel. J.M. v. Taylor, ___ W.Va. ___, 276 S.E.2d 199 (1981), we should hold that no confession can be taken from a juvenile unless his counsel is present. Taylor dealt with the waiver of a juvenile's right to counsel during formal juvenile proceedings and we held that a waiver of the right to counsel during such hearings could only occur upon the advice of counsel.[3]
In two recent cases, we have held that Taylor does not foreclose a juvenile from waiving his Miranda rights and making a valid confession. State v. Howerton, ___ W.Va. ___, 329 S.E.2d 874 (1985); State v. Manns, ___ W.Va. ___, 329 S.E.2d 865 (1985). Both of these decisions recognized that there are statutory restrictions with *506 regard to taking juvenile confessions, but where they are not applicable, the validity of a juvenile's confession is determined by the totality of the circumstances. This we summarized in Syllabus Point 3 of Howerton, which modified Syllabus Point 1 of State v. Laws, 162 W.Va. 359, 251 S.E.2d 769 (1978):[4]
"[Subject to the provisions of W.Va. Code, 49-5-1(d),] [t]here is no constitutional impediment which prevents a minor above the age of tender years solely by virtue of his minority from executing an effective waiver of rights; however, such waiver must be closely scrutinized under the totality of the circumstances."
W.Va. Code, 49-5-1(d) (1982),[5] was in existence at the time the confessions were taken in this case, however, its provisions do not prevent a juvenile over sixteen from giving a confession without the presence of counsel, parents or custodian.
There is no contention made in this appeal that the confessions were otherwise invalid because of the lack of Miranda warnings, or that the waiver was not intelligently made, or that the confessions were not freely and voluntarily given. We, therefore, conclude under the totality of the circumstances that the confessions were not invalid for lack of counsel.
The second attack on the written confession is premised on the requirements of W.Va. Code, 49-5-8(d), which relates to a prompt detention hearing, and provides, in part:
"A child in custody must immediately be taken before a referee or judge of the circuit court and in no event shall a delay exceed the next succeeding judicial day: Provided, that if there be no judge or referee then available in the county, then such child shall be taken immediately before any magistrate in the county for the sole purpose of holding a detention hearing. The judge, referee or magistrate shall inform the child of his right to remain silent, that any statement may be used against him and of his right to counsel and no interrogation shall be made without the presence of a parent or counsel."
The language of this provision is not without some ambiguity. The first sentence begins with the statement that a child in custody "must immediately be taken before a referee or judge." It then proceeds with this statement "and in no event shall a delay exceed the next succeeding judicial day." The sentence then ends with this proviso: "Provided, that if there be no judge or referee then available in the county, then such child shall be taken immediately before any magistrate in the county for the sole purpose of holding a detention hearing." This proviso was placed in W.Va. Code, 49-5-8(d), in 1978.[6]
The function of a proviso in a statute is to modify, restrain, or conditionally qualify the preceding subject to which it refers. Eaton v. County Court of Cabell County, 140 W.Va. 498, 85 S.E.2d 648 (1955); State v. Cunningham, 90 W.Va. *507 806, 111 S.E. 835 (1922); Dan River Mills, Inc. v. City of Danville, 194 Va. 654, 75 S.E.2d 72 (1953); 1A Sutherland Statutory Construction § 20.22 (4th ed. 1972). Here, we believe the proviso is designed to ensure that if a juvenile referee or judge is not available, a child in custody must be immediately brought before a magistrate. In placing this construction on the statute, we have restricted the import of the preceding language that indicates a delay may not "exceed the next succeeding judicial day."
We do so because we do not believe that this language was intended to sanction any delay in taking a juvenile directly to a judicial officer. Rather, this clause relates to how long a detention hearing may lawfully be delayed while a child is held in custody. There is a temporal difference between advising a juvenile as to his rights and arranging to have a formal detention hearing with the juvenile's counsel being present. It is obvious that advising the juvenile as to his constitutional rights can be done immediately on the appearance of the child. Whereas, a detention hearing requiring the presence of counsel may take some additional time. It is for this reason that the legislature provided for some leeway with regard to the completion of the detention hearing.
Furthermore, our interpretation is buttressed by W.Va. Code, 49-5A-2, which relates to arrested juveniles and provides in material part: "A child who has been arrested or who under color of law is taken into the custody of any officer or employee of the State or any political subdivision thereof shall be forthwith afforded a hearing to ascertain if such child shall be further detained." (Emphasis added). There is a direct connection between W.Va. Code, 49-5A-2, and a detention hearing under W.Va. Code, 49-5-8, because W.Va. Code, 49-5A-2, refers to the provisions of W.Va. Code, 49-5-1, et seq., and requires that such hearing procedures shall apply.[7] The term "forthwith" reinforces the detention statute language "must immediately be taken" and compels the conclusion that the legislature expected arrested juveniles to be brought immediately to a magistrate or other judicial officer. See State ex rel. M.C.H. v. Kinder, ___ W.Va. ___, 317 S.E.2d 150 (1984).
The purposes of a prompt detention hearing under W.Va. Code, 49-5-8(d), are for a neutral judicial officer to inform the child of his constitutional rights and to determine whether he should be released from custody to his parents or other appropriate person or agency.
The similarity between a juvenile detention hearing and the initial presentment of an adult before a magistrate under W.Va. Code, 62-1-5, is apparent. In State v. Persinger, ___ W.Va. ___, 286 S.E.2d 261 (1982), we discussed the provision in W.Va. Code, 62-1-5, requiring that an officer making an arrest "shall take the arrested person without unnecessary delay before a magistrate," and pointed out that it was designed to enable a neutral and detached magistrate to test whether there was probable cause for an arrest when the arrest had been made without a warrant. Furthermore, it ensured that a defendant would be promptly advised by a magistrate of the nature of the charge and his constitutional right against self-incrimination and the right to counsel.
All of this was designed to bring a detached judicial officer into the process once an arrest had been made to furnish meaningful protection for a defendant's constitutional *508 rights. These same considerations apply to juvenile defendants even more forcibly because of their age and immaturity. Furthermore, because of the likelihood that a juvenile who commits a serious crime may be transferred to the adult jurisdiction of the circuit court under W.Va. Code, 49-5-10, there is a need to ensure that his constitutional rights are preserved at the initial proceedings.
We recognized in Syllabus Point 6 of Persinger that where an arresting officer's delay in taking an adult defendant to a magistrate was primarily for the purpose of obtaining his confession, such delay may very well vitiate the confession under the prompt presentment or unnecessary delay provision of W.Va. Code, 62-1-5. Syllabus Point 6 provides: "The delay in taking the defendant to a magistrate may be a critical factor where it appears that the primary purpose of the delay was to obtain a confession from the defendant."
Certainly, the "unnecessary delay" language in W.Va. Code, 62-1-5, is much less forceful than the language of W.Va. Code, 49-5-8(d), requiring that once a juvenile is placed in custody he "must immediately be taken before a referee or judge of the circuit court."
Consequently, we conclude that under W.Va. Code, 49-5-8(d), when a juvenile is taken into custody, he must immediately be taken before a referee, circuit judge, or magistrate. If there is a failure to do so, any confession obtained as a result of the delay will be invalid where it appears that the primary purpose of the delay was to obtain a confession from the juvenile.[8]
We recognize that in certain situations a confession otherwise proper is not necessarily invalid because it was obtained before the juvenile was brought before a referee, judge or magistrate. In Persinger, we stated that the time consumed in transporting the defendant from where he is apprehended to the magistrate's office is not counted. We also indicated that the State can justify delay by showing the necessity of performing customary booking and administrative procedures as outlined in Johnson v. State, 282 Md. 314, 329, 384 A.2d 709, 717 (1978).[9] In the present case, the oral confession given by the juvenile shortly after he was placed in the police cruiser is not invalid. Proper Miranda warnings had been given and these rights had been waived prior to his confession. The juvenile being over sixteen years of age was outside the special statutory age limitations on confessions contained in W.Va. Code, 49-5-1(d). There was no evidence that the police were taking a circuitous journey to have more time to obtain the confession.
Furthermore, we believe that the subsequent written confession is also admissible. It is generally recognized that ordinarily the time taken to reduce an oral *509 confession to writing does not count on the unreasonable delay issue. United States v. Candella, 469 F.2d 173, 175-76 (2d Cir. 1972); Lewis v. State, 285 Md. 705, 718, 404 A.2d 1073, 1080 (1979); State v. Reynolds, 298 N.C. 380, 399, 259 S.E.2d 843, 854 (1979), cert. denied, 446 U.S. 941, 100 S.Ct. 2164, 64 L.Ed.2d 795 (1980); Commonwealth v. Penn, 497 Pa. 232, 239-40, 439 A.2d 1154, 1158, cert. denied, 456 U.S. 980, 102 S.Ct. 2251, 72 L.Ed.2d 857 (1982); Richmond v. State, 554 P.2d 1217, 1229 (Wyo.1976); Annot., 28 A.L.R.4th 1121 (1984). See State v. Mitter, ___ W.Va. ___, ___, 289 S.E.2d 457, 461 (1982). The underlying rationale for permitting the oral confession to be reduced to writing is to promote the accuracy and memorialization of the matters contained therein.[10]
In this case, the written confession was preceded by an additional giving of the Miranda rights and the juvenile's waiver of these rights. The written statement was started approximately one hour after the juvenile was first picked up. The record does not disclose how long it took to transport him nor the exact time period from the oral confession in the police cruiser to the start of the written confession, but the interval was clearly less than one hour.
An additional point touched upon by the parties is the meaning of the term "custody" as used in W.Va. Code, 49-5-8. It is apparent from this section that the term "custody" is equivalent to an arrest, that is, it must be based upon probable cause where the juvenile is being taken into custody for an act which if committed by an adult would be a crime. Under both W.Va. Code, 49-5-8(a), where the juvenile is being taken into custody under the authority of an order, and W.Va. Code, 49-5-8(b), where the taking into custody is without a warrant, similar grounds must "exist for the arrest of an adult in identical circumstances." In the case of an adult, he may be taken into custody by virtue of an arrest warrant but, of course, such warrant must be issued based upon probable cause. State ex rel. Burdette v. Scott, 163 W.Va. 705, 259 S.E.2d 626 (1979). Where the arrest or taking into custody is in public without a warrant, it must be "based on probable cause that the person has or is about to commit a felony." Syllabus Point 4, in part, State v. Howerton, supra.
Consequently, it can be seen that under both W.Va. Code, 49-5-8(a) and -8(b), the grounds for taking a juvenile into custody where the juvenile has allegedly committed a criminal act are the same as for the arrest of an adult. Once such custodial arrest of a juvenile has occurred, his right to be immediately taken before a judicial officer arises under W.Va. Code, 49-5-8(d). Again, we are fortified in this conclusion by the language of W.Va. Code, 49-5A-2, which speaks of "[a] child who has been arrested or who under color of law is taken into ... custody ... shall be forthwith afforded a hearing."
The State seems to concede this point since it argues that the police did not have probable cause to believe the juvenile committed the crime and, consequently, W.Va. Code, 49-5-8, does not apply. However, we believe the police did have probable cause because at the time the juvenile was picked up it was already known that he had been present with the victim at the time of the quarry incident and they also had information indicating that the juvenile had been paid to push the victim into the quarry.
Even if we were to accept the State's argument that there was no probable cause for the juvenile's arrest and he had agreed to accompany the police to the station, a written confession taken under these circumstances would not necessarily be valid. The validity of such a confession, independent of the age restrictions in W.Va. Code, 49-5-1(d), will turn on the *510 custodial circumstances as we have outlined in State v. Stanley, ___ W.Va. ___, 284 S.E.2d 367 (1981). In Stanley, we followed Dunaway v. New York, 442 U.S. 200, 99 S.Ct. 2248, 60 L.Ed.2d 824 (1979), and concluded that where a suspect is not free to leave the officer's place of questioning, then an illegal detention has occurred and a confession obtained under such circumstances, even though preceded by Miranda warnings, would be invalid unless there was a break in the causal connection between the illegal detention and the confession.[11]See also State v. Mays, ___ W.Va. ___, 307 S.E.2d 655 (1983); State v. Sprouse, ___ W.Va. ___, 297 S.E.2d 833 (1982). Other courts have adopted much the same view of juvenile confessions taken while the child is illegally detained in a Dunaway circumstance. People v. Saiz, 620 P.2d 15 (Colo.1980); In Interest of Foster, 66 Ill.App.3d 193, 22 Ill.Dec. 947, 383 N.E.2d 755 (1978); State v. Ann Marie C., 407 A.2d 715 (Me.1979).
The juvenile's confessions were properly admitted in evidence, therefore, the trial court's transfer order cannot be reversed as there was sufficient evidence establishing probable cause to believe that the juvenile had committed murder. For the reasons stated, the order transferring the juvenile to adult criminal jurisdiction is affirmed.
Affirmed.
NOTES
[1]  In the past in juvenile cases, we have utilized the initials of the juvenile. Because initials are difficult to recall, we have elected to utilize the juvenile's first name coupled with his initials. This is a practice evolved in other courts. See Fare v. Michael C., 442 U.S. 707, 99 S.Ct. 2560, 61 L.Ed.2d 197 (1979); In Re Anthony E., 72 A.D.2d 699, 421 N.Y.S.2d 566 (1979).
[2]  The parties focus only on the written confession taken at the police headquarters, but there was an earlier oral confession in the cruiser when the juvenile was first picked up. This becomes important in light of our ultimate holding.
[3]  Syllabus Point 1 of Taylor states: "A juvenile defendant cannot waive his right to counsel during proceedings against him, unless he does so upon advice of counsel."
[4]  Laws decided the standard for a juvenile's confession and involved a confession before the age restrictions were enacted in W.Va. Code, 49-5-1(d). We adopted the totality of the circumstances rule which is in accord with a majority of jurisdictions and Fare v. Michael C., 442 U.S. 707, 99 S.Ct. 2560, 61 L.Ed.2d 197 (1979).
[5]  The relevant portion of W.Va. Code, 49-5-1(d) (1982), states:

"Extrajudicial statements, other than res gestae, by a child under fourteen years of age to law-enforcement officials or while in custody, shall not be admissible unless made in the presence of the child's counsel.
"Extrajudicial statements, other than res gestae by a child under sixteen years of age but above the age of thirteen to law-enforcement officers or while in custody, shall not be admissible unless made in the presence of the child's counsel or made in the presence of and with the consent of the child's parent or custodian who has been fully informed regarding the child's right to a prompt detention hearing, his right to counsel including appointed counsel if he cannot afford counsel, and his privilege against self-incrimination."
[6]  The first sentence of W.Va. Code, 49-5-8(d), prior to the insertion of the proviso, read: "A child in custody must immediately be taken before a referee or judge of the circuit court and in no event shall a delay exceed the next succeeding judicial day, excluding Saturday."
[7]  The full text of W.Va. Code, 49-5A-2, is:

"A child who has been arrested or who under color of law is taken into the custody of any officer or employee of the State or any political subdivision thereof shall be forthwith afforded a hearing to ascertain if such child shall be further detained. In connection with any such hearing, the provisions of article five [§ 49-5-1 et seq.] of this chapter shall apply. It shall be the duty of the judge or referee to avoid incarceration of such child in any jail. Unless the circumstances of the case otherwise require, taking into account the welfare of the child as well as the interest of society, such child shall be released forthwith into the custody of his parent or parents, relative, custodian or other responsible adult or agency."
[8]  Because of the differing language in the various juvenile statutes with regard to presentment before a magistrate, other courts' decisions are not particularly helpful. Courts in several states that have a prompt presentment provision for juveniles taken into custody have foreclosed confessions obtained where the police have interrogated the juvenile before taking him to a magistrate. See, e.g., State v. Shaw, 93 Ariz. 40, 378 P.2d 487 (1963); Roberts v. State, 285 So.2d 385 (Fla.1973); M.K.H. v. State, 135 Ga.App. 565, 218 S.E.2d 284 (1975); People v. Wolff, 23 Mich.App. 550, 179 N.W.2d 206 (1970); State v. Wade, 531 S.W.2d 726 (Mo.1976) (En Banc); In Re Anthony E., 72 A.D.2d 699, 421 N.Y.S.2d 566 (1979).
[9]  The quotation from Johnson cited in Persinger is:

"`Examples of necessary delay might include those required: 1) to carry out reasonable routine administrative procedures such as recording, fingerprinting and photographing; 2) to determine whether a charging document should be issued accusing the arrestee of a crime; 3) to verify the commission of the crimes specified in the charging document; 4) to obtain information likely to be a significant aid in averting harm to persons or loss to property of substantial value; 5) to obtain relevant nontestimonial information likely to be significant in discovering the identity or location of other persons who may have been associated with the arrestee in the commission of the offense for which he was apprehended, or in preventing the loss, alteration or destruction of evidence relating to such crime.'" ___ W.Va. at ___, 286 S.E.2d at 270. (Footnote omitted).
[10]  In Lewis v. State, 285 Md. at 718, 404 A.2d at 1080, the Maryland Supreme Court in speaking of the delay occasioned by reducing an oral confession to writing stated: "Instead, it is designed to insure that what the defendant desires to relate is accurately recorded. This clearly serves the interests of both the State and the defendant."
[11]  Syllabus Points 1 and 2 of Stanley state:

"1. Where police, lacking probable cause to arrest, ask suspects to accompany them to police headquarters and then interrogate them intermittently for seven hours during which time they are not free to leave or their liberty is restrained, the police have violated the Fourth Amendment.
"2. A confession obtained by exploitation of an illegal arrest is inadmissible. The giving of Miranda warnings is not enough, by itself, to break the causal connection between an illegal arrest and the confession. In considering whether the confession is a result of the exploitation of an illegal arrest, the court should consider the temporal proximity of the arrest and confession; the presence or absence of intervening circumstances in addition to the Miranda warnings; and the purpose or flagrancy of the official misconduct."
