returning a middle element for linked list