chop trailing newline (check code with flake8 to see a couple other minor formatting things)