Added end comments to function magic.