
318 S.E.2d 446 (1984)
STATE ex rel. Ronald Edward FETTERS, Sr.
v.
The Honorable Donald C. HOTT.
No. 16106.
Supreme Court of Appeals of West Virginia.
June 26, 1984.
*447 Phil Jordan, Keyser, for relator.
Janet Frye Steele, Asst. Atty. Gen., Charleston, for respondent.
NEELY, Justice.
This case comes before us on a rule to show cause in prohibition under the criteria of Hinkle v. Black, 262 S.E.2d 744 (W.Va.1979). The relator claims that his trial and conviction in the Circuit Court of Mineral County was in violation of the Agreement on Detainers, W.Va.Code 62-14-1 [1971]. Essentially, relator argues that it was improper to try him in West Virginia once he had been returned to Maryland. The State replies that the return was an "informal transfer" and, therefore, not covered by the statutory language. As this issue presents us with a matter of statutory construction of a uniform, nationwide statute we follow case law from other jurisdictions and deny the writ.

I
The relator, Ronald Fetters, was incarcerated in the Allegheny County jail in Maryland under a five-year sentence. During his incarceration, he learned that a detainer had been filed charging him with breaking and entering a store in Mineral County, West Virginia. Mr. Fetters invoked Article III of the Agreement on Detainers and was transported to the Mineral County Detention Center in Keyser, West Virginia, on 26 July 1983.[1]
Mr. Fetters remained in West Virginia until 11 October 1983 when a deputy from Allegheny County, Maryland, took him back to Maryland for a probation hearing. Before removing Mr. Fetters, Allegheny County officials spoke by telephone with the sheriff of Mineral County. The Mineral County jail administrator signed a release and allowed Mr. Fetters' return to Maryland with the deputy. No other West Virginia official was consulted or notified.
Upon his return to Maryland, Mr. Fetters was again incarcerated in the Allegheny County jail. After the probation hearing, he was transferred by Maryland authorities to the state prison in Baltimore. On 14 November 1983, thirty-four days after his *448 departure from West Virginia, Mr. Fetters was returned to this state to stand trial. The lawyer for relator moved to dismiss the charge on the grounds that trying Mr. Fetters after he had been returned to Maryland violated the clear language of the Agreement on Detainers. The trial court ruled that dismissal was not necessary in this case because the transfer had not resulted from a court order. Mr. Fetters' return was, in the court's language, nevertheless, "illegal, unjustified, and unauthorized." Relator was tried and found guilty of breaking and entering by the Mineral County Circuit Court on 29 November 1983.

II
The relator relies on Article III(d) of the Agreement on Detainers. That section states in relevant part:
If trial is not had on any indictment, information or complaint contemplated hereby prior to the return of the prisoner to the original place of imprisonment, such indictment, information or complaint shall not be of any further force or effect, and the court shall enter an order dismissing the same with prejudice.
W.Va.Code 62-14-1 [1971]. Relator argues that this language is mandatory. He cites Syl.Pt. 4 of Moore v. Whyte, 266 S.E.2d 137 (W.Va.1980), which states, "[i]f West Virginia obtains custody of a prisoner against whom a detainer has been lodged and returns him to the original place of confinement before trying him, the charge must be dismissed with prejudice." Therefore, the relator claims the circuit court acted improperly by trying and convicting him.
The case before us is distinguishable from Moore v. Whyte, supra. The relator's case does not concern an infringement of the mandatory time within which the accused must be brought to trial. When Mr. Fetters sought disposition of the charges against him, the State of West Virginia received one hundred and eighty days to try him under Article III(a).[2] The relator's day in court came one hundred and twenty-six days after he first arrived in West Virginia (including the period during which he was returned to the sending state for his probation hearing.)
In upholding the transfer in this case, the circuit court relied on a distinction between formal and informal removals that is not found in the statute. However, Article IX of the Agreement on Detainers states that, "[t]his agreement shall be liberally construed so as to effectuate its purposes." The official action which resulted in the relator's return to Maryland for a probation hearing before his trial and conviction in West Virginia, while not a model of efficient judicial administration, does not make it impossible under the facts of this case to try relator on the West Virginia charges.
The Agreement on Detainers is in force in nearly all states. Article I proclaims the overriding purpose of the agreement to be "to encourage the expeditious and orderly disposition" of charges pending against prisoners held in other jurisdictions. As the United States Supreme Court indicated in United States v. Mauro, 436 U.S. 340, 98 S.Ct. 1834, 56 L.Ed.2d 329 (1978), the signatories to this model statute hoped it would allow corrections officers to establish effective rehabilitation programs without shuffling prisoners from one state's penitentiaries to another's.
This Court rejects the lower court's distinction between formal and informal transfers because that distinction invites abuse. However, the Court believes it would undermine the spirit of the Agreement on Detainers, as stated in Article I, were it to adopt a hard and fast rule prohibiting transfers. Other jurisdictions have held limited transfers permissible. In United States v. Boyce, 518 F.Supp. 862 (E.D.Va.1981), aff'g. 611 F.2d 530 (4th Cir.1979) a state prisoner was removed to the federal *449 authorities in the same city and then returned a few hours later to state custody before resolution of the federal charges against him. Vacation of the sentence under Article IV(e) of the Agreement on Detainers was held unwarranted because the technical violation fell "short of a fundamental defect causing a complete miscarriage of justice or of other exceptional circumstances." Boyce, at 864. Hitchcock v. United States, 580 F.2d 964 (9th Cir.1978); United States v. Boniface, 601 F.2d 390 (9th Cir.1979); United States v. Chico, 558 F.2d 1047 (2d Cir.1977), cert. denied, 436 U.S. 947, 98 S.Ct. 2850, 56 L.Ed.2d 788. Transfers of federal prisoners intrastate to state authorities for arraignment and speedy return to federal custody have also been held not to violate the Agreement on Detainers. State ex rel. Stanley v. Davis, 569 S.W.2d 202 (Mo.App.1978).
More to the point, however, are cases from jurisdictions that have allowed limited return to the sending state when done in the interests of the accused and when consonant with the purposes of the Interstate Agreement on Detainers. People v. Bernstein, 74 Misc.2d 714, 344 N.Y.S.2d 786 (1973) (unpreparedness of counsel); Neville v. Friedman, 67 Ill.2d 488, 10 Ill.Dec. 575, 367 N.E.2d 1341 (1977) (lengthy indefinite continuance and return to sending state granted without objection); State v. Sassoon, 240 Ga. 745, 242 S.E.2d 121 (1978) (prisoner returned untried from state to federal custody to receive medical treatment and continue a rehabilitative program). This narrower approach we find more palatable. A transfer back to the sending jurisdiction, done in the prisoner's best interests, is not prohibited.
Let us suppose, for example, that a District of Columbia prisoner is sought in Jefferson County and is, accordingly, transferred there. While in custody awaiting trial the prisoner requires heart surgery and is returned to the District of Columbia for medical treatment because the District of Columbia has a facility superior to anything available in Jefferson County and closer than any suitable facility in West Virginia. In such a case no one should contend that the prisoner is entitled to have the West Virginia charge dismissed against him.
Relator's return to Maryland before his West Virginia trial was for the purpose of attending a probation hearing. This transfer was certainly in the relator's own best interest and the record before us is utterly devoid of any allegation that the transfer back to Maryland injured or prejudiced the relator in any way. A probation hearing could have resulted in the modification or suspension of relator's sentence and the purpose of his transfer back to Maryland was in perfect harmoney with the goals of the Agreement on Detainers.
Consequently, we decline to look to the language concerning transfers back to the sending state in the Agreement on Detainers out of the context of the entire statute. In light of the fact that the Agreement on Detainers is a lengthy statute that establishes a comprehensive plan for the transfer of prisoners from one jurisdiction to another it must be interpreted by looking at all its provisions synoptically, and not by looking at specific provisions out of context.
As we said in Syllabus Points one, two and three of Smith v. State Workmen's Compensation Commissioner, 159 W.Va. 108, 219 S.E.2d 361 (1975):
1. "The primary object in construing a statute is to ascertain and give effect to the intent of the Legislature.
2. "In ascertaining legislative intent, effect must be given to each part of the statute and to the statute as a whole so as to accomplish the general purpose of the legislation.
3. "Statutes which relate to the same subject matter should be read and applied together so that the Legislature's intention can be gathered from the whole of the enactments."
In the case before us there was no violation of the spirit or intent of the statute.
*450 The writ of prohibition is denied.
Writ Denied.
NOTES
[1]  Apparently, Maryland prison officials failed to send necessary documents to the prosecutor and clerk of the Mineral County Circuit Court. Nevertheless, the circuit court found that relator was present pursuant to the Agreement on Detainers because relator had done everything within his power to activate that agreement. The prosecutor did not object. Therefore, we will assume that the Agreement on Detainers is controlling.
[2]  Under Article IV(c) of the Agreement on Detainers a shorter period of one hundred twenty days applies where the receiving state lodges a detainer against a prisoner serving a sentence in another jurisdiction.
