 Bruce Joel Rubin (qv) originally wrote the film in the early 70s  and spent years trying to get it produced, with no success. It  eventually came to Adrian Lyne (qv), who worked closely with Rubin  to rewrite and condense a good deal of the story.