Fixed a couple of errors and Formatted code.