fix minor error in code sample, improve formatting