remove trailing whitespace, fix indentation