Added fucntion to reverse linked list.