Added curly brackets where they had been left out of the code snippets. Also fixed two grammatical errors on line 52