Append and prepend in a double linked list