Add list reversal and duplicate removal functions.