 The court may order the defendant to undergo physical castration, provided the defendant file a written motion with the court, stating that he intelligently and knowingly gives his voluntary consent to physical castration as an alternative to the treatment. The act states,