Implement destructor, setNext, and getData methods