Minor reformatting in readme

This fixes the code example and also removes some trailing whitespace.