several formatting changes to fit the code snippets provided by Xcode