cleanup
formatting
cleanup
cleanup and portability upgrades