the movie was written by david mamet