Generic vs. Brand

Does a generic version of the pill work just as good as a branded one?