added subsections in examples, minor edits