add recursion algorithm for reversing list