Rahim (not his real name) scored nine points for the O-level examination last year, with distinctions in subjects such as principles of accounts and combined science in physics and biology.
Unlike most students, he took the national exam while in prison.
The 21-year-old, who will take his A levels later this year, attends the Tanah Merah Prison School - the only such school in Singapore.
Over the past five years, it has seen a jump of more than 20 per cent in the number of inmates taking the N, O or A levels, from 193 in 2011 to 239 last year.
The inmates take the same papers as students in mainstream schools. Some use their new qualifications to further their studies.
I think I've wasted my youth. Opportunities were presented to me, but I didn't see them... In here, I started to worry about my future. Prison school is a second chance. I want to prove that I am a changed person.
RAHIM, who was detained without trial for gang-related activities when he was 17. Now 21, he will sit the A-level exam this year.
Tanah Merah Prison superintendent Loh Hong Wai said education plays a crucial role in the rehabilitation of inmates. With their qualifications, it is easier for them to find jobs after release, and this reduces re-offending rates.
"Increasingly, there's a greater awareness among the inmates about the importance of education," he said.
The school's youngest student is 17. The oldest, at 62, will be taking his O levels this year. "It is never too late to learn," said Supt Loh.
But not everyone can get into the school, which has a total capacity of 250. Admission is based on the inmates' academic qualifications, their conduct in prison, as well as recommendations from supervisors. Many have not picked up a textbook for years.
"We tell the inmates prison school is not exactly easy, because everything is tough and rigorous, especially for those who have not studied for a long time," said Supt Loh.
To expose students to questions likely to appear in the exams, teachers provide past years' papers, including those from top schools, for the inmates to work on.
Like his classmates, Rahim often requests extra test papers. Because, he said, "we are so committed".
Whenever the exam season approaches, Rahim would step up the revision in his cell, even after the lights-out time at 10pm. "I would push myself, sometimes even until 11.30pm," he said.
He is not the only one, as student inmates are often in a race against time. Unlike mainstream schools, the prison school's curriculum is "very much compressed", said Ms Phang Ka Leng, the prison school's vice-principal.
"They don't have the luxury of time," said Ms Phang, explaining that the curriculum is geared towards helping student inmates excel at the exams. This allows them to move on to more advanced levels in a shorter time.
The inmates have only a year - or 10 months to be precise - to prepare for the N or O levels, unlike the four to five years for students in mainstream schools. Those taking the A levelscan choose to sit the exam within one or two years.
Besides preparing students for national exams, the school also offers Nitec in Electronics and General Education courses.
A typical school day begins at 8am and ends at 3pm. Classes, held five days a week, are taught by teachers seconded from the Education Ministry, along with part-time teachers and volunteers.
For weaker students who require more help, the school taps volunteers to hold evening tutorials.
But it is not all work and no play.
After school, student inmates can take up enrichment activities - almost like co-curricular activities in mainstream schools. Held on Mondays for about three hours, the activities include reading, dancing or playing a musical instrument such as the guitar and the cajon, a box- shaped percussion instrument.
Supt Loh explained: "We strive to provide a holistic education. Prison school is not just about academic results. We also strive to impart the right values to them, so that upon their release they can go back to society as responsible and law-abiding citizens."
Rahim admits he wasted his teenage years mixing with unsavoury company.
His gang involvement landed him in jail at the age of 17. He was detained without trial for gang-related activities.
"I think I've wasted my youth. Opportunities were presented to me, but I didn't see them," he said.
"In here, I started to worry about my future. Prison school is a second chance. I want to prove that I am a changed person."
He hopes to pursue a business degree after his release and aspires to be an entrepreneur and support his three siblings, aged four to 16. His parents, who are in their early 40s, run their own business.
"When I came in, I was very young. I didn't know the consequences of my actions," he said. "I don't think I will go back to my old friends. My focus is different now."