Rafi (not his real name) scored 34 points for his O levels in 2007 and was determined to do better.
Using just the corridor light that shone into his prison cell, the 24-year-old said he would study until midnight, beyond his daily lights-out time at 10pm.
Rafi is a student at Tanah Merah Prison School, which 230 male inmates attend while they serve sentences for theft, drug-related crimes and other offences. The four-storey, 20-year-old building is housed within a cluster in the Changi Prison Complex.
His hard work paid off. He sat the O levels again last year and scored an impressive 11 points. He even attained an A1 for a combined science subject, despite taking biology for the first time in his life.
He told The Sunday Times: "I was shocked to see my results. I didn't think I could do so well."
Those selected for the school are generally of good behaviour and have displayed an aptitude for studying. The students are aged 18 to 40. Many have not opened a textbook in years. They adhere to a standard dress code - a plain white T-shirt - and shave their heads.
The school prepares students for O, N and A-level exams. Nitec and bridging classes, from primary to secondary levels, are also offered. Classes are typically conducted from 8am to 3pm on weekdays.
More than just a place of learning, the school is meant to inspire hope in the inmates that a better future awaits them, said the school's principal, Mr Leong Sow Phong. "What drives me to work would definitely be the thought of giving some hope to the 'hopeless'," he said.
Rafi once thought he was hopeless. "I didn't like to study and I thought I couldn't study. But when I started studying, I realised I could do it," he said.
Another inmate, Aaron (not his real name), also experienced that turnaround while studying behind bars. He scored an F9 for O-level mathematics in 2007 and thought he was terrible at the subject.
The 26-year-old realised he was wrong when he scored well in his maths tests in the prison school. "Soon, my roommate started asking me for help. Later on, I took the initiative to help others too," he said.
Like Rafi, the former 35-pointer retook his O levels last year. He scored 15 points and a B3 for maths. "I never cared about my results in the past. But now, I feel disappointed if I don't do well. I've started to set expectations for myself," said Aaron.
Messages of self-belief and positivity are posted around the school. One, by American civil rights activist Martin Luther King Jr, reads: "Take the first step in faith. You don't have to see the whole staircase, just take the first step."
At the same time, science lab stools are chained to the ground so they cannot be thrown, while scissors are secured to workbenches and toilets have plastic instead of glass mirrors.
Teachers and visitors are required to wear wireless alarms on their wrists in case of emergencies. But Mr Lee Chee Khuen, who has taught in the school since 2009, says he has "never had to use it".
In fact, the school's teachers told The Sunday Times that they do not face any disciplinary issues with students. Rather, the challenge they have is in helping them shed their lack of self-confidence.
Said Mr Lee, 52: "Many of them, especially those in their 30s, will tell you they've not studied for a long time."
He is one of 15 teachers seconded from the Ministry of Education. The other 16 work part-time.
His colleague, Madam Nashita Allaudin, 36, said many students have the potential to do well but need "constant encouragement".
"They know they've missed out on much in life, so they try very hard. They volunteer to do more and ask their classmates for help," she added.
Last year, the percentage of inmates who scored five or more O-level passes went up from about 56 per cent in 2011 to 69 per cent, while those who attained at least two H2 passes and a pass in General Paper for A levels went up from about 52 per cent in 2011 to close to 86 per cent.
Said Madam Nashita: "It's truly meaningful, especially when the students collect their results and you see their disbelieving, happy faces. They are thinking, 'How did I get this far,' and you know you've helped them unlock their potential."
It will be some time before Rafi and Aaron are released, but they are already planning for their future.
Rafi wants to sit the A levels next year, while Aaron has been equipping himself with digital media editing skills. He hopes to study IT or mass communications in a polytechnic after his release.
Both will receive a National Youth Achievement Award in front of their parents at a ceremony tomorrow.
Another proud recipient of the award will be Alkaff (not his real name), a school dropout who landed in jail for gang-related activities and robbery.
The 23-year-old took the A levels at the end of last year and got five As.
He was released on supervision last December and is now a barista who hopes to study sport science and management at Nanyang Technological University.
"I couldn't stop smiling when I got my results," he said. "I'm glad I did not lose sight of my goals and focused on doing my best."
His story mirrors that of former inmate Darren Tan, who is on course to graduate with a law degree from the National University of Singapore this year. The 34-year-old had sat his A levels while behind bars when he was 25 and scored four As and a B.
These four young men are intent on looking ahead.
Said Rafi: "I'm just learning whatever I can every day. When I get out, I'll choose my friends wisely."
Alkaff agreed, adding: "I'm never going back to the life I once had."