
92 Wn.2d 128 (1979)
594 P.2d 917
THE STATE OF WASHINGTON, Petitioner,
v.
DENNY J. HUNTZINGER, Respondent.
No. 45631.
The Supreme Court of Washington, En Banc.
May 10, 1979.
*129 C.J. Rabideau, Prosecuting Attorney, and Irene Cleavenger, Deputy, for petitioner.
D. Wayne Campbell and Campbell, Johnston & Roach, for respondent.
STAFFORD, J.
The State seeks review of a Court of Appeals decision reversing the trial court for having omitted a finding of fact concerning defendant's alleged sexual psychopathy. We affirm the Court of Appeals as modified.
On October 4, 1976, defendant was arrested and charged with rape in the first degree, statutory rape in the first degree, kidnapping in the first degree, abduction, assault in the second degree and unlawful imprisonment. The charges arose out of three separate incidents involving young girls aged 11, 12 and 14. Defendant entered a plea of not guilty and in the alternative asserted that he was mentally irresponsible at the time the crimes were committed. Later, defendant and the prosecuting attorney entered into an agreement that defendant would plead guilty to rape in the first degree, statutory rape and unlawful imprisonment provided the prosecuting attorney would move to dismiss the other three counts. In addition the prosecuting attorney agreed to inform the court that defendant appeared to be a sexual psychopath, to recommend that he be sent to Western State Hospital (Western) for a 90-day period of observation, examination and treatment, to recommend the *130 sentence be deferred and defendant permanently committed to Western for treatment, and to suggest that upon his return to the court following commitment and treatment he be placed on probation. Defendant and the prosecuting attorney explained the arrangement to the trial judge. The judge accepted defendant's plea, dismissed the other counts, signed an order stating that there were reasonable grounds to believe defendant was a sexual psychopath, and committed him to Western for a 90-day period of observation, evaluation and treatment.
At the conclusion of the period as required by the trial judge's original order, defendant was returned to the trial court for sentencing and commitment. The superintendent of Western provided the court with a written report stating that defendant was indeed a sexual psychopath and recommending his commitment to Western for further treatment. The prosecuting attorney presented the proposed order deferring sentence, as agreed, as well as the proposed findings of fact that defendant was a sexual psychopath, that he was not safe to be at large, and that he should be treated at Western for sexual psychopathy. The agreed proposed conclusion of law directly reflected the proposed findings of fact providing that defendant was a "sexual psychopath within the meaning of RCW 71.07." (Italics ours.)
The trial judge refused to sign either the proposed order deferring sentence or the proposed findings of fact and conclusions of law. Instead he directed the prosecuting attorney to prepare a judgment and sentence for the three crimes to which defendant had pleaded guilty. Upon this turn of events defendant requested that the court enter a finding concerning his status as a sexual psychopath, as required by RCW 71.06. Although the trial judge announced orally he would be glad to find defendant was a sexual psychopath he refused to sign such a finding on the ground that it was not relevant to the matter of sentencing.
Before sentencing, defendant moved to withdraw his pleas of guilty and reinstate his original pleas of not guilty. *131 The motion was denied. Thereafter, defendant was sentenced to not more than 10 years for assault in the second degree, not more than life for statutory rape in the first degree, and not more than life for rape in the first degree, all to run concurrently. He was given credit for time previously served. After sentence was imposed defendant moved, unsuccessfully, to set aside the judgment and sentence.
Defendant appealed claiming the trial court erred by entering judgment and sentence rather than committing him to Western for treatment. The Court of Appeals remanded the cause ordering the trial court to make a finding of fact on the issue of sexual psychopathy as required by RCW 71.06.060. The State appealed. We affirm the Court of Appeals as modified.
RCW 71.06 establishes procedures for determining the sexual psychopath status of defendants charged with sex offenses. It also provides for commitment to a state institution once such a determination is made. Normally, in any proceeding wherein the defendant is charged with a sex offense, the prosecuting attorney may file a petition alleging that the defendant is a sexual psychopath and stating sufficient facts to support the allegation. RCW 71.06.020. The court then proceeds to hear the criminal charge and if the defendant is convicted or has previously pleaded guilty, judgment and sentence are pronounced. Thereafter, the court is required to consider the allegation of sexual psychopathy. RCW 71.06.030. If reasonable grounds are found to believe the defendant is a sexual psychopath, the court orders the defendant confined at the nearest state hospital for a period of observation not to exceed 90 days. RCW 71.06.040. Upon completion of the observation period, the superintendent of the hospital is required to return the defendant to the court together with a written report of his findings on the issue of sexual psychopathy giving the factual basis for his opinion. RCW 71.06.050. The statutory section at the heart of the instant challenge is RCW 71.06.060 which reads in pertinent part:

*132 After the superintendent's report has been filed, the court shall determine whether or not the defendant is a sexual psychopath. If said defendant is found to be a sexual psychopath, the court shall commit him to the director of the department of institutions for designation of the facility for detention, care, and treatment of the sexual psychopath. If the defendant is found not to be a sexual psychopath, the court shall order the sentence to be executed ...
[1] Without question the procedure followed in the instant case departs somewhat from the statutory scheme of RCW 71.06. The prosecutor orally petitioned the court for determination of sexual psychopathy rather than filing a written petition and the trial judge ordered observation, evaluation and treatment at Western prior to having sentenced defendant rather than subsequent thereto. The primary question is whether the parties, and particularly the trial judge, were in fact proceeding under RCW 71.06 or under normal sentencing procedures.
The fact of substantial compliance with the statute suggests that initially the parties and the judge intended to proceed pursuant to the authority of RCW 71.06 rather than under normal sentencing procedures. First, the judge signed an order stating that there were reasonable grounds to believe defendant was a sexual psychopath and committing him to Western for a period of observation, evaluation and treatment not to exceed 90 days. Second, the superintendent of Western provided the trial court with a report on defendant's status as a sexual psychopath as required by the court and RCW 71.06.050. Third, the prosecuting attorney presented a finding of sexual psychopathy based expressly upon RCW 71.06. Finally, the trial judge orally stated his belief that defendant was in fact a sexual psychopath.
Strict compliance with the procedures of RCW 71.06 would have been the preferable method of resolving the issue of sexual psychopathy. Nevertheless, in light of the unusual circumstances outlined above, we believe the post-observation *133 requirements of RCW 71.06 should have been followed by the trial judge.
[2] The next issue is the proper construction of RCW 71.06.060 quoted above. The statute provides that the trial court shall determine whether the defendant is a sexual psychopath. In determining the meaning of the word "shall" we traditionally have considered the legislative intent as evidenced by all the terms and provisions of the act in relation to the subject of the legislation, the nature of the act, the general object to be accomplished and consequences that would result from construing the particular statute in one way or another. State v. McDonald, 89 Wn.2d 256, 571 P.2d 930 (1977); Spokane County ex rel. Sullivan v. Glover, 2 Wn.2d 162, 97 P.2d 628 (1940).
[3] RCW 71.06 employs both the word "shall" and the word "may" in defining the various responsibilities of the prosecuting attorney and the judge. The language of one section (RCW 71.06.030) was amended in 1967 by deletion of the word "may" and substitution therefore of the word "shall". Laws of 1967, ch. 104, § 1, p. 457. This careful choice of language indicates the legislature considered the two words to have different force, that is, to be directory when "may" is used, mandatory when "shall" is used. In light of these considerations it is clear the legislature intended the language of RCW 71.06.060 to be mandatory. In addition, although RCW 71.06 contains no express statement of purpose, the existence of the procedures for determining sexual psychopathy in itself indicates legislative recognition of an alternative to criminal punishment through segregation, treatment and rehabilitation of sexual psychopaths. This fact further supports construing the language of RCW 71.06.060 as mandatory.
The cause is remanded to the trial court for a hearing and determination as to whether defendant is in fact a sexual psychopath and for entry of an appropriate finding as required by RCW 71.06.060. If defendant is found to be a sexual psychopath, the court shall commit him to the *134 Department of Social and Health Services for placement in an appropriate facility.
UTTER, C.J., and ROSELLINI, WRIGHT, BRACHTENBACH, HOROWITZ, DOLLIVER, HICKS, and WILLIAMS, JJ., concur.
Reconsideration denied June 18, 1979.
