added linkedlist reverse function