 After completing a show in Chicago, they joined Rihanna in the studio, where Timberlake experimented with beats and melodies.Weeks later, the three got together in New York City, where Timberlake had already conceptualized a song for Rihanna.Timbaland, who wanted to compose a song called "Rehab" for Rihanna, was producing a beat, when Timberlake came in and improvised the song over it.