Added a few comments and changed whitespace