replace tabs by 4 spaces and delete trailing spaces
replace 'open - close' with 'with open' constructs
cosmetic changes