Added initDiscard function