Corrected spelling, grammar and added indentations to code.