Added comments to confusing or messy code.