Switch to linked-list based algorithm