minor formatting
cosmetic changes to minimize diff to upstream
drastic changes to minimize diff to upstream. it's now probably broken but i compiles.