Added comments to explain lines of code.