compiled changes from gavin, a few small edits