delivered the opinion of the court:
The People of the State of Illinois appeal from an order of the circuit court of Madison County, entered November 18, 1991, imposing a sanction pursuant to Supreme Court Rule 415(g)(i) (134 Ill. 2d R. *40415(g)(i)), for the State’s failure to comply earlier with discovery. The sanction ordered the exclusion of certain evidence, including the confession of defendant, Nathaniel Hawkins.
On April 26, 1991, defendant, along with two codefendants, was charged with the offense of robbery in that, on April 17, 1991, he took two pizzas from Eobert Lytle by the use of force. Defendant was arrested on October 1, 1991, and his bail was set at $30,000. On October 4, 1991, defendant filed his motion for discovery before trial requesting, among other things, all written or recorded statements and the substance of any oral statements made by the defendant and a list of witnesses to the making of such statements. Defendant also filed a written demand for speedy trial.
On October 11, 1991, defendant was arraigned. He waived his right to a preliminary hearing and entered a plea of not guilty. The court entered a discovery order granting the State 10 days in which to comply.
The cause came on for pretrial conference on November 18, 1991. The State informed the court that it had that date filed some supplementary discovery that had not earlier been tendered to the defendant. The prosecutor explained that he had not been aware of the materials until recently when he spoke with the investigating police agency. The prosecutor indicated that, other than a statement of the defendant contained in the supplemental discovery materials, the supplemental discovery was cumulative to materials already disclosed to the defendant. The State indicated that it was ready to proceed to trial with this discovery, or in the alternative, if the court deemed it just, the State requested a continuance to allow defendant to review and respond to the supplemental discovery. The State had not sought any previous continuances, and defendant had only been in custody since October 1, 1991. Defendant objected to a continuance and asked that the case proceed to trial with the exclusion from evidence of the supplemental discovery materials, including the confession of defendant.
It is apparent from the transcripts of the hearing held on November 18, 1991, and a subsequent hearing held on November 19, 1991, that the initial discovery disclosed by the State consisted of 28 pages and did not contain any statements of the defendant. The supplemental discovery consisted of 104 pages and included a confession made by the defendant.
The court denied the State’s motion for a continuance and ordered the cause set for trial the next day, November 19, 1991, with all supplemental discovery to be excluded from evidence. On November *4119, 1991, the State made an oral motion for reconsideration. The court pointed out that the State had announced ready for trial on October 28, 1991, and the cause had been set for jury trial on November 18, 1991, by agreement of the parties. The court denied the State’s motion for reconsideration. The State informed the court that it was filing a notice of appeal and did so on November 19, 1991. The State’s certificate of substantial impairment was filed in this court on January 17,1992.
Supreme Court Rule 415(g) provides that:
“If at any time during the course of the proceedings it is brought to the attention of the court that a party has failed to comply with an applicable discovery rule or an order issued pursuant thereto, the court may order such party to permit the discovery of material and information not previously disclosed, grant a continuance, exclude such evidence, or enter such other order as it deems just under the circumstances.” (134 Ill. 2d R. 415(g)(i)-)
The State does not contend on appeal that the court erred in finding that it had failed to comply with an applicable discovery rule or order, or in imposing a sanction for that failure to comply. The State does argue, however, that the court erred in imposing the harsh sanction of excluding from evidence the discovery materials, including defendant’s confession, when the preferred sanctions of a recess or a continuance would have been effective in protecting the defendant from surprise and prejudice. We agree with the State that exclusion of the evidence was too harsh a sanction and that the State’s motion for a continuance should have been granted.
The goal of discovery is to eliminate surprise and unfairness and afford opportunity to investigate. (People v. Nelson (1980), 92 Ill. App. 3d 35, 44, 415 N.E.2d 688, 696.) Sanctions are designed to accomplish the goal of discovery (People v. Rayford (1976), 43 Ill. App. 3d 283, 286, 356 N.E.2d 1274, 1277), that is to compel compliance rather than to punish. (People v. Stuckey (1979), 78 Ill. App. 3d 1085, 1090, 398 N.E.2d 97, 102.) For this reason, exclusion of evidence is not favored as a sanction as it does not contribute to the goal of truth seeking. (Stuckey, 78 Ill. App. 3d at 1090, 398 N.E.2d at 102.) The preferred sanction is a recess or continuance if the granting thereof would be effective to protect the defendant from surprise or prejudice (People v. Aguilar (1991), 218 Ill. App. 3d 1, 9-10, 578 N.E.2d 109, 115), and exclusion of evidence is a last resort, demanded only where a recess or a continuance would be ineffective. Nelson, 92 Ill. App. 3d at 45, 415 N.E.2d at 696.
*42The correct sanction to be applied is left to the trial court’s discretion, and the judgment of the trial judge is given great weight. (People v. Morgan (1986), 112 Ill. 2d 111, 135, 492 N.E.2d 1303, 1312.) However, where the trial judge abuses that discretion, it may constitute reversible error. (Stuckey, 78 Ill. App. 3d at 1091, 398 N.E.2d at 102.) Such is the case here.
As the prosecutor pointed out to the trial judge, the defendant had been arrested on October 1, 1991, and had been in custody only 48 days. The State had not sought any continuances of the matter and had been trying to negotiate some plea agreement with the defendant. While not dispositive, we think that whether the State acted in bad faith, or willfully failed to disclose discoverable materials, is a factor to be considered by us. Here, there is no evidence that the State acted in bad faith in failing to earlier disclose the supplemental materials or that it intentionally or knowingly held those materials back. While we acknowledge that it is the duty of the State to see that there is a proper flow of information between the various branches and personnel of its law enforcement agencies and its legal officers (People v. Miles (1980), 82 Ill. App. 3d 922, 928, 403 N.E.2d 587, 592), we think the State’s lack of willfulness in failing to disclose mitigates against the harsh sanction of exclusion.
Furthermore, the evidence excluded included the confession of defendant, evidence often recognized as of convincing character and as the highest kind of evidence known to the law. (People v. Husar (1974), 22 Ill. App. 3d 758, 767, 318 N.E.2d 24, 32; People v. Green (1959), 17 Ill. 2d 35, 41, 160 N.E.2d 814, 818.) Defendant argues that, because the confession itself is not part of the record on appeal, the State has failed to show any prejudice as a result of its exclusion. We think that, given the nature of a confession, prejudice to the prosecution is a reasonable inference from its exclusion.
A continuance in the instant case would have been effective in eliminating any surprise and prejudice to defendant. Defendant had not been in custody an inordinate amount of time. His trial had not yet commenced, and he still would have had the opportunity to fashion his defense with the benefit of the supplemental discovery materials. (Cf. People v. Aguilar (1991), 218 Ill. App. 3d 1, 578 N.E.2d 109.) Defendant would have had time to interview additional witnesses if necessary and engage in additional investigation. If appropriate, defendant would have had the opportunity to file a motion to suppress his confession. We fail to see what prejudice defendant would have suffered as a result of a short continuance.
*43On the other hand, the exclusion of evidence including defendant’s confession did not promote the fact-finding process or aid in the search for truth, both goals of the discovery process. (People v. Rayford (1976), 43 Ill. App. 3d 283, 286, 356 N.E.2d 1274, 1277; People v. Goodman (1977), 55 Ill. App. 3d 294, 296, 371 N.E.2d 168, 169.) In People v. Endress (1969), 106 Ill. App. 2d 217, 223, 245 N.E.2d 26, 29, while recognizing that suppressing nondisclosed yet discoverable items of evidence may be an effective method of compelling compliance with the discovery, we pointed out that an order suppressing evidence as a sanction has the effect of decreasing the equality necessary for a fair trial. We think in the instant case the granting of a continuance would have been just as effective a method of compelling compliance with discovery without having had the effect of decreasing the equality necessary for a fair trial.
Because we find that the trial court abused its discretion in imposing the harsh sanction of exclusion of evidence for the State’s failure to timely comply with discovery where the preferred sanction of a continuance would have been effective in protecting the defendant from surprise and prejudice, we reverse the order of the trial court of November 18, 1991, which imposed the sanction and remand this cause to the circuit court of Madison County for further proceedings not inconsistent with this opinion.
Reversed and remanded.
CHAPMAN and W.A. LEWIS, JJ., concur.