added reverse linkedlist funciton