cleanup for submission to doug

added ina bunch of comments,etc.