Written for the screen by Schrader, of course. A good, thought-provoking effort. 

A minority view for sure but I must say that I've been fairly disappointed by the three features Scorsese has made so far this decade -- though they happen to be some of his most critically and commercially successful films to date (heck, one even garnered him that much-coveted Academy Award).