Added double-linked lists for connection handling.