
300 N.W.2d 847 (1980)
Jenny MANSUKHANI, Plaintiff and Appellee,
v.
Donald and Jean PAILING, Defendants and Appellants,
Sandy Pailing, Jane Doe and Richard Roe, Defendants.
Civ. No. 9855.
Supreme Court of North Dakota.
December 19, 1980.
*849 Mills & Moore, Bismarck, for plaintiff and appellee; argued by Sherry Mills Moore, Bismarck.
Chapman & Chapman, Bismarck, for defendants and appellants; argued by Daniel J. Chapman, Bismarck.
SAND, Justice.
Donald and Jean Pailing, the grandparents of the children, appealed from a district court judgment arising out of a petition for writ of habeas corpus and also from a district court bench order, all pertaining to the mother's visitation rights with her children.
James A. Pailing and Jenny Failing were married and had two children, Jennifer Ann and Allen Anthony. On 4 Oct. 1977 they were divorced. Custody of the two minor children was awarded to James A. Pailing, the father, with "reasonable visitation rights including the right to have custody of said children overnight and on weekends" to the mother, Jenny Pailing. After the divorce, James Failing, with the children, lived with his parents, Donald and Jean Pailing. The mother, Jenny Pailing, remarried and is now Mrs. Jenny Mansukhani. In July 1980 the father, James Pailing, was killed in an automobile accident. The children continued to live with their grandparents, Mr. and Mrs. Don Pailing.
The grandparents and the mother disagreed as to who should have custody of the children. Neither could they agree on the conditions under which the mother could exercise her visitation rights. The mother filed a writ of habeas corpus petitioning the district court for custody of the children.
There was a dispute as to when the mother last visited the children, whether it was on 11 Dec. 1978, according to grandparents Pailing, or April 1979 according to the mother, Jenny M. Mansukhani.
After a brief hearing, the court issued a judgment containing the following pertinent provisions:
"1. Jenny Mansukhani being the mother and having a priority over said children as such shall be awarded the custody.
"2. There shall be a transitional period during which Jenny Mansukhani shall be entitled to the following visitation:
That upon 24 hours notice to the Pailings, she may take the children from 8 o'clock a.m. to 8 o'clock p.m. the same day. On her fourth visit, she may have the children for a 48 hour period.
"3. The transitional period shall end one week after Jenny Mansukhani has completed four visits made at least one week apart.
"4. At the end of the transitional period, physical possession and custody of the children shall be transferred to Jenny Mansukhani."
The grandparents, Mr. and Mrs. Donald Pailing, filed a petition with the district court for reconsideration and a stay order, which was denied. The grandparents then appealed to this Court and sought a stay of the visitation order of the district court, which was granted. This was followed by further proceedings in the district court resulting in a bench order allowing the mother to immediate overnight visitations. The bench order, upon application of the grandparents, was also stayed by this Court.
The principle issue is whether or not the procedures for writ of habeas corpus without an evidentiary hearing are appropriate for the determination of custody of the children. A related issue is whether or not the death of the father constituted a change *850 of circumstances so as to modify the divorce decree and the custody judgment which did not provide with specificity the circumstances under which visitation could be had.
Generally habeas corpus is a summary proceeding primarily used and designed to liberate a person from illegal confinement. 39 Am.Jur.2d Habeas Corpus, §§ 2, 9. It is a common law prerogative writ and has been used in child custody matters for many years. 39 Am.Jur.2d Habeas Corpus, §§ 8, 118. We can only speculate when it was first used in child custody cases and why it was used. However, when the writ is used to obtain custody of a child it becomes an equitable action in which equitable principles must be employed. In re Wagner, 84 N.W.2d 587 (N.D.1957).
The writ of habeas corpus[1] has been used to obtain custody of a child since 1913, or earlier, in this State. Knapp v. Tolan, 26 N.D. 23, 142 N.W. 915 (1913). However, an examination of the general procedures and statutory provisions of Chapter 32-22, NDCC, relating and applying to habeas corpus, leads us to the inescapable conclusion that the objectives and procedures used in a writ of habeas corpus unless substantially modified are unrealistic and inappropriate for determining the custody of a child especially because of changed circumstances where the best interests of the child are involved.
In a habeas corpus proceeding evidence is generally presented in the form of verified pleadings and affidavits. Consequently, if the evidence is in dispute, which usually is the situation in child custody matters where the best interests of the child are paramount, the judge as the trier of facts does not have the benefit of observing the demeanor of the witnesses (verifier of pleadings and affiants). Neither does the judge or the parties have the benefit of cross-examination. In addition, the affidavits are frequently couched in conclusionary statements consisting of an interrelated mixture of fact and law, making the decision more complex. The judge in a custody case has a most difficult responsibility. An evidentiary hearing would be of great aid and benefit to the judge in examining and weighing the evidence before making the all-important findings of fact.
The usual habeas corpus proceeding without substantial modification does not provide the aids and benefits which are associated with an evidentiary hearing and are essential in a child custody matter.
It, therefore, seems logical, and we believe it would be more appropriate and would be a better procedure for a litigant seeking custody of a child because of changed circumstances,[2] to initiate an action or proceedings by using a complaint, petition, or application stating the facts and the nature of the matter and the remedial relief sought [see, Galloway v. Pruitt, 469 S.W.2d 556, 558 (Ky.1971)], or by a motion if the parties are the same as those in the divorce decree or judgment, and requesting an evidentiary hearing whenever the evidence is in dispute.
We also believe that the trial judge will accord priority to proceedings of this nature and will expeditiously hear and determine the issues and exercise sound discretion, all within the framework of due process.
With reference to special procedural remedies, in State v. Morrissey, 295 N.W.2d 307, 309 (N.D.1979), Justice Paulson, writing for the Court, said:
"Recently this court has experienced an increasing use among North Dakota practitioners of these somewhat antiquated and dust-laden procedural devices. [Writs of certiorari, mandamus, and prohibition.] It may well be time for the Legislature to take a long and searching look at these devices to determine how they fit into modern legal practices." *851 To this we add that the time may be appropriate for the Legislature to review all of the special proceedings under the title "Judicial Remedies" with a view of bringing them in line with the modern practice which no longer employs the strict common law pleading. In making this observation we are not suggesting the elimination of habeas corpus which is protected by Section 5 of the North Dakota Constitution providing that the writ of habeas corpus shall not be suspended except under certain conditions. We are merely observing that a writ of habeas corpus was not designed for matters other than originally intended. Other proceedings may be employed as mentioned earlier herein. We note that the various writs which were formerly found in Sections 87 and 103 of the old Judicial Article have been removed and are now merely referred to as writs necessary to the proper administration of justice in Sections 92 and 86 of the new Judicial Article.
In the instant case, based upon the hearing and proceedings before the trial court on 17 Oct. 1980 there appears to be a mild confusion, or at least some uncertainty, as to what specific remedy Jenny Mansukhani sought. It appears that the mother, Jenny Mansukhani, sought actual custody of the children as distinguished from visitation rights. Her custody claim is predicated on the premise that when the father died she automatically became entitled to custody of the children. In any event, or at the very least, she contended she is entitled to continued visitation rights in accordance with the divorce decree. The divorce decree merely provided for "reasonable visitation rights including overnight and weekend visits" without spelling out the details. Furthermore, prior to the father's death any agreement that may have existed between the father and mother as to visitation rights was not in writing.
Relying on the judgment issued in the instant case, the writ was not used to free children unlawfully denied of their liberty or to enforce a decree or judgment but was used in an effort to obtain custody of the children because of changed circumstances which requires giving full faith and recognition to the legal and equitable concepts of the best interests of the child.
We share the concern of the trial court as garnered from the record that the writ of habeas corpus[3] is simply not designed to meet the basic judicial procedures and requirements for determining the custody of a child.
The grandparents made an adequate request before the trial court to convert the habeas corpus proceedings into an evidentiary hearing, which we believe is necessary under the circumstances in this case. We believe the ends of justice will be better served if an evidentiary hearing is held and, accordingly, the judgment of the district court is vacated and the case is remanded in line with the views expressed in this opinion for an evidentiary hearing.
We conclude that the death of the father, who had legal custody of the children, constitutes a change in circumstances even though physical or actual custody was with the grandparents. The court, however, must take into account all of the surrounding circumstances in reaching its decision.
The bench order[4] of the trial court issued on 17 Oct. 1980 was issued after the notice of appeal was filed with the clerk of court on 10 Sept. 1980 and after the Supreme Court had issued its stay order on the 12th day of September, 1980, covering substantially the same subject, and under these circumstances the bench order was and is null and void.
*852 On remand, we invite the trial court's attention to the principles of equity and law expressed in Hust v. Hust, 295 N.W.2d 316 (N.D.1980); J. L. R. v. Kidder County Social Services Board, 295 N.W.2d 401 (N.D.1980); In Interest [Custody] of D. G., 246 N.W.2d 892 (N.D.1976); Bjerke v. D. T., 248 N.W.2d 808 (N.D.1976); and McKay v. Mitzel, 137 N.W.2d 792 (N.D.1965), together with other citations and case law referred to by the above cases on the subject matter.
These cases clearly express the rule of law that the court must be concerned with the best interests and welfare of the child by taking into account all of the pertinent facts and surrounding circumstances which may have a bearing on or influence the child's welfare. Some of these cases also establish that the rights of a biological parent are not necessarily always paramount but must be balanced with the best interests and welfare of the child.
This case is remanded with directions to hold an evidentiary hearing to determine whether the mother or grandparents shall have custody of the children and who may have visitation rights with conditions, if any.
ERICKSTAD, C. J., and VANDE WALLE, PEDERSON and PAULSON, JJ., concur.
NOTES
[1]  Section 14-09-06, NDCC, specifically provides that when the husband and wife are separated habeas corpus may be used to inquire into the custody of the child or children and may award custody to one or the other under such regulations as the case requires.
[2]  The writ of habeas corpus is probably more pertinent in "child snatching" cases than in other cases because of the nature of the issue involved which comes close to liberating an "imprisoned" child.
[3]  Proceedings in habeas corpus to obtain custody of a child are governed by considerations of expediency and equity and should not be bound by technical rules. Gray v. Maxwell, 206 Neb. 385, 293 N.W.2d 90 (1980).
[4]  Because of the disposition of the bench order, it will not be necessary to resolve whether or not the bench order is appealable. Nevertheless, because the subject matter involves the basic jurisdiction of the court, we state this caveat that a party filing a notice of appeal on a bench order will have the full responsibility of convincing this Court that the order is appealable under the laws of this State.
