Added discard function.