applied nearly all changes of second revision from peter