Added some comments on code and fixed spacing.