implement singly linked list and removing nth element from end