Dumped by his girlfriend, 22-year-old Chew Yew Heong decided to go after women who resembled her - slim and around 1.65m tall.
In a spree of terror across five days in March, the Malaysian attacked and molested four such women, aged between 17 and 22.
After he was arrested on March 17, it was also found that he had overstayed here for more than a year.
When he was sentenced yesterday to six years and 21/2 months in jail and 15 strokes of the cane, District Judge Mathew Joseph called Chew's conduct "absolutely despicable". It was a "strange way to remember his ex-girlfriend", he added.
Investigations revealed that when Chew came to Singapore through the Woodlands Checkpoint on Jan 2 last year, he was issued a four-day pass.
But he continued staying here illegally to be with his girlfriend.
She then broke up with him.
From March 11 this year, the unemployed Chew would loiter in the Tampines area late at night and follow women from bus stops.
He then molested them at the ground floor lift lobby or inside the lift.
In one particular incident on March 15, he trailed a 17-year-old student after she alighted from a bus at about 11.30pm.
In the lift at her block of flats, she pressed the button for the 12th storey. He pressed for the 11th.
When the only other person in the lift got off on the fourth storey, Chew secretly pressed the seventh, eight and ninth floor buttons, so as to give him more time alone with his victim.
When the lift stopped at the seventh floor, he walked past the teenager as if he wanted to leave, but spun around and grabbed her chest with both hands.
By the time the startled teen had struggled free, the doors had closed. She retreated to the back of the lift and tried to use her phone to call for help but he snatched it away.
He then hugged her and touched her chest again. When she started screaming, he covered her mouth.
But she managed to escape and run down the staircase when the lift doors opened on the ninth floor.
For each act of molestation, Chew could have been jailed for up to two years, fined or caned.
The penalty for overstaying for more than 90 days is a jail term of up to six months and at least three strokes of the cane.