adding list reversal function