 Alex singing and dancing to "Singing in the Rain" as he beats and  ties up the writer and his wife was not scripted.  Stanley Kubrick (qv) spent four days experimenting with this  scene, finding it too conventional. Eventually he approached  Malcolm McDowell (qv) and asked him if he could dance. They tried  the scene again, this time with McDowell doing an improv of Alex  singing and dancing. Kubrick was so amused by it that he and  McDowell drove back to his home, where he swiftly bought the rights  to "Singing in the Rain" for $10,000.