In accordance with his guilty pleas, Private First Class (PFC) Fuson was convicted by a special court-martial, military judge alone, of wrongfully using marijuana on three occasions in violation of Article 112a, Uniform Code of Military Justice, 10 U.S.C. § 912a. The military judge sentenced him to confinement for 75 days, forfeiture of $639 pay per month for three months, reduction to pay grade E-l, and a bad-conduct discharge. In accordance with the pretrial agreement, the convening authority approved the sentence and suspended confinement in excess of 60 days. He also directed confinement credit of 32 days for pretrial confinement in accordance with United States v. Allen, 17 M.J. 126 (C.M.A.1984).1
In this appeal, the appellant assigns two errors:
I.
THE MILITARY JUDGE ERRED IN FAILING TO ADJUDICATE AND STATE, ON THE RECORD, THE SPECIFIC CREDIT TO BE APPLIED BY THE CONVENING AUTHORITY AGAINST THE ADJUDGED SENTENCE.
II.
APPELLANT IS ENTITLED TO AN ADDITIONAL 32 DAYS OF ADMINISTRATIVE CREDIT AGAINST HIS SENTENCE TO CONFINEMENT AS THE RESULT OF PRETRIAL CONFINEMENT WHICH WAS MORE RIGOROUS THAN THE CIRCUMSTANCES REQUIRED TO INSURE HIS PRESENCE AT TRIAL.
We have decided to afford the appellant relief as to his sentence based on both issues.
ISSUE I
a. Facts
The appellant pleaded guilty to wrongfully using marijuana on or about 1 October 1998, 15 March 1999, and 24 March 1999. Following an inquiry into the providence of his pleas, the military judge found the appellant guilty of all three specifications. During the presentencing hearing, the trial counsel offered Prosecution Exhibit 1 (12 pages from the appellant’s service record), into evidence. Page 10 of the exhibit reflected that the appellant had received nonjudicial punishment on 23 November 1998 for use of marijuana on or about 1 October 1998. The defense did not object to the exhibit, and the military judge admitted the documents. The following then took place:
MJ: Further evidence?
TC: Nothing further, Your Honor.
MJ: The government rests?
TC: Yes, sir.
MJ: I want to address one matter here. This was mentioned at an 802 session just prior to coming on the record. Included in Prosecution Exhibit 1 is a record of nonjudicial punishment, held on 23 November 1998, referencing a urinalysis conducted on 1 October 1998, evidently, the same urinalysis which resulted in Specification 2 of Charge II to which the accused has been found guilty.
So this is the same offense. Right, Defense Counsel?
DC: Yes, sir.
MJ: Both sides agree that this is a— would not be considered a minor offense for purposes of former jeopardy or double jeopardy?
TC: Yes, sir.
DC: Yes, sir.
MJ: Okay. But I will certainly take into account that the accused was reduced to his current rate, grade; restricted for 45 days; given 45 days extra duties; *525and forfeited a total of $600, as a result of that one use.
Any objections to that?
TC: No, Your Honor.
DC: No, sir.
Record at 36-37 (emphasis added). In his argument on sentence, the trial counsel mentioned the appellant’s nonjudicial punishment and how he had “popped positive” twice since then for using marijuana. He also mentioned the appellant’s counseling for the same nonjudicial punishment. Record at 37-38. Neither the staff judge advocate’s recommendation nor the convening authority’s action mentioned the awarding of any credit for the prior punishment.
b. Discussion
United States v. Pierce, 27 M.J. 367 (C.M.A.1989), involved circumstances similar to those in the case at bar. There, the accused was convicted by a court-martial of an offense for which he had previously received nonjudicial punishment under Article 15, UCMJ. The military judge stated he would ‘Consider” the previous punishment in assessing the sentence. The accused objected for the first time on appeal that there was a denial of military due process and a violation of Article 13, UCMJ, 10 U.S.C. § 813. Although the Court held there was no violation of military due process to convict a service member at a court-martial for a serious offense after previously receiving nonjudicial punishment for that offense, it made clear that he could not be punished twice for the same offense. It stated that in such cases, an accused must be given complete credit for the prior nonjudicial punishment received, “day-for-day, dollar-for-dollar, stripe-for-stripe.” Pierce, 27 M.J. at 369.
The Court further stated that evidence of the prior nonjudicial punishment for the same offense cannot be used for any purpose at trial, and that it has no legal relevance to the court-martial. Id. The Court even went so fax* as to suggest that a violation of military due process may occur in the use of the prior punishment for any purpose. Pierce, 27 M.J. at 369 n. 4. The Court indicated that it could not tell what the militaxy judge meant by his comment that he would “consider” the prior punishment. It concluded that it would remand the record to the lower court to decide whether to ascertain from the military judge what he meant or to adjust the sentence.
In United States v. Edwards, 42 M.J. 381 (1995), the Court held that the military judge could properly apply the Pierce credit. In Pierce, it had stated that the duty to apply the credit could not always be conferred on the couxT-martial, and that the best place to repose the responsibility to ensure that credit is given is the convening authority. Pierce, 27 M.J. at 369. But in Edwards, the military judge had taken it upon himself to apply the credit, and he did so in great detail on the record. He explained what his original sentence was, how much credit he was applying, his calculations, and what the resultant punishment would be. Edwards, 42 M.J. at 382. In cases where the military judge applies the credit, the convening authority has no further responsibility in this regard. Edwards, 42 M.J. at 381.
In United States v. Gammons, 51 M.J. 169 (1999), the Court provided a lengthy discussion of this issue. In Gammons, the trial counsel offered evidence of the nonjudicial punishment at the px-e-sentencing hearing. The military judge noted that it was for the same offense as was before the court-martial, and asked the defense counsel if there was any objection to it. The defense counsel declined to object, but indicated that the matter would be addressed during its ease in extenuation and mitigation. The Court held that the accused is properly “the gatekeeper” of the l'ecord of nonjudicial punishment in such cases. Gammons, 51 M.J. at 179-80. And, as noted in Pierce, the prosecution may not introduce such evidence. Gammons, 51 M.J. at 183. When the defense introduces it, however, the military judge will state on the record the specific credit awarded for the prior punishment. Gammons, 51 M.J. at 184 (emphasis added). If the Court of Criminal Appeals is unable to discern whether the military judge or the convening authority applied the credit, the Court could either obtain an explanation from the military judge or adjust the sentence to assure that the appellant was not twice punished. Id.
*526Based on these principles, we find error in the trial counsel’s introduction of evidence of the appellant’s prior nonjudicial punishment for use of marijuana on or about 1 October 1998 when the appellant had just been convicted of the same offense at the court-martial. Gammons, 51 M.J. at 175-79; Pierce, 27 M.J. at 369. The nonjudicial punishment simply had no further legal relevance for the prosecution. The accused is the gatekeeper of the introduction of such evidence, not the prosecution. It does not make any sense for the prosecution to offer evidence of the prior punishment for the same offense as a matter in aggravation. We wish to reemphasize to trial counsel that they should not offer such evidence in aggravation unless the accused has misled the court-martial. Gammons, 51 M.J. at 183; Pierce, 27 M.J. at 369.
As mentioned by the Government in its brief, the defense did not object. And, as pointed out in Gammons, the waiver doctrine may be applied in the absence of plain error. Plain error exists where there is plain or obvious error that materially prejudices the substantial rights of an accused. United States v. Reist, 50 M.J. 108, 110 (1999); United States v. Powell, 49 M.J. 460, 465 (1998). In this case, we find that the error was plain, but we are unable to determine whether it materially prejudiced the appellant’s substantial rights. We cannot tell from the words of the military judge whether he actually applied the Pierce credit or whether he simply took the prior punishment “into account” in a general sense. If he did the latter, the appellant may well have suffered material prejudice in the service of further confinement after trial that he may not have otherwise served. We are aware, based upon documents filed by the Government, that the appellant served 17 days in confinement after trial. This is similar to the situation in Pierce where the military judge “considered” the previous nonjudicial punishment. Rather than delay this case further to obtain the military judges’s explanation, and in the interest of judicial economy, we will adjust the appellant’s sentence “to assure that he was not twice punished.” Pierce, 27 M.J. at 370.
We also wish to reemphasize to military judges that in applying a Pierce credit, as authorized in Edwards, they must clearly state on the record the specific credit awarded for the prior punishment, no matter which party has offered the record. We do not read Gammons as requiring this information only when it is offered by the accused. We also strongly discourage use of language by military judges that they will “take into account” or “consider” the prior punishment in reaching a sentence. Such language spawns issues on appeal and leaves us unsure of what has been done.
ISSUE II
a. Facts
The appellant served 32 days of pretrial confinement in “special quarters” at the Marine Corps Base Brig, Camp Pendleton. The appellant made no motion at trial for additional credit for pretrial confinement on account of this situation,2 but he asked in his written unsworn statement during the presentencing hearing for the military judge to consider the conditions he endured there. He wrote that these included a 6’ x 9’ cell with no windows, and having to remain in his cell 24 hours per day except for chow and a one-hour recreation break Monday through Friday. The trial counsel stated to the court: ‘Your Honor, the reason why the accused is in special quarters is because of his medical condition. It’s not a form of punishment. It’s because it is to protect himself and to maintain good order within the brig.” Record at 38.
b. Discussion
Citing Anderson and United States v. Huffman, 40 M.J. 225 (C.M.A.1994), the appellant now requests that we order an additional 32 days of credit in addition to his Allen credit. In Anderson, we directed an additional credit for an accused who was placed in “special quarters” to serve pretrial confinement at Camp Pendleton when the only reason he was there was the length of potential confinement he faced at court-martial. Anderson, 49 M.J. at 576-77. In Huffman, the Court held that waiver will not be invoked on this issue unless there is an affir*527mative, fully developed waiver on the record. Huffman, 40 M.J. at 227.3
The Government argues that when the appellant raised this matter in his unsworn statement, it amounted to an affirmative waiver on the record of the issue of illegal pretrial confinement. And, even if not waived, the pretrial confinement was not egregious and served a legitimate government purpose. The Government has submitted documents to us indicating that the appellant was placed in “special quarters” due to a strained right knee. It takes the position that the intent was not to punish the appellant, but to accommodate his medical condition. It provides no other justification for the accused’s placement in “special quarters.”
Article 13, UCMJ, prohibits the imposition of punishment or penalty upon an accused prior to trial, as well as pretrial confinement conditions that are more rigorous than the circumstances require “to insure” the accused’s presence at trial. United States v. McCarthy, 47 M.J. 162, 165 (1997); Anderson, 49 M.J. at 576. The Article 13 prohibition bars both the imposition of punishment prior to trial, and the infliction of unduly rigorous circumstances during pretrial detention which, in sufficiently egregious circumstances, may give rise to a permissible inference that an accused is being punished, or may be so excessive as to constitute punishment. McCarthy, 47 M.J. at 165.
We disagree with the Government’s argument that the appellant waived this issue. We find no affirmative, fully developed waiver in this record. We also disagree that the conditions were not egregious or that the appellant’s placement in “special quarters” served a legitimate government purpose. We cannot condone the imposition of harsher conditions upon a military accused in pretrial confinement because he has an injury or, for that matter, suffers some other illness. We think it is somewhat obvious that having a strained right knee does not make an accused a greater flight risk or that placement in “special quarters” is necessary to ensure the presence of such injured personnel for trial. The appellant was not a “management problem” or a disciplinary problem in the brig. His conduct was consistently evaluated as “sat,” (satisfactory) on the “Inspection Record of Prisoner in Segregation” that the Government filed by motion. We see no legitimate governmental purpose in imposing harsher conditions on injured pretrial confinees than on uninjured pretrial confinees. We find that the conditions imposed on this appellant were unduly rigorous and gave rise to a permissible inference that he was punished in pretrial detention.4 We will therefore award the appellant an additional 32 days of credit against his sentence to confinement.
Disposition
The findings, as approved on review below, are affirmed. We have carefully examined the sentence adjudged and the credits we have found to be due the appellant. In view of the above, we affirm only so much of the sentence as includes a bad-conduct discharge.
Judge OZMUN and Judge ANDERSON concur.
. Both parties have noted a discrepancy in the post-trial processing of this case. The convening authority’s action is dated 15 September 1999; the recommendation of the staff judge advocate is dated 6 October 1999. A convening authority may not act without the recommendation of the staff judge advocate or legal officer. Art. 60, UCMJ, 10 U.S.C. § 860. The appellant informs us that this was simply a clerical error, and that there has been no prejudice. Given these representations, we will not order relief. United States v. Wheelus, 49 M.J. 283, 289 (1998).
. See United States v. Anderson, 49 M.J. 575 (N.M.Ct.Crim.App.1998).
. The principles of Huffman have been recently upheld in United States v. Scalarone, 54 M.J. 114 (2000).
. We are not holding that injured pretrial confinees cannot be segregated from the general population. But, if segregated, they must be accommodated in conditions no worse than if they were healthy.