code formatting and minor changes in example