added a soln for reversing a list