all but the discard function completed for challenge 8