Pushed a fairly complete version.