fixed spacing, added comments to code