added recursive list reversal