Added comments to explain some stuff.