Reverse a single linked list problem solved