add double-ended list function