more c++11 compatibility changes
comment changes; extraneous local variables removed