         return _back.prev.value;
     }
 
-    public function pushFront(element:*):void
-    {
-        if (element == null)
-        {
-            throw new ArgumentError("DequeSet cannot contain null members");
-        }
-        var node:Node = takeNode(element);
+    public function pushFront(member:*):void
+    {
+        checkMember(member);
+        var node:Node = takeNode(member);
         Node.insertAfter(_front, node);
     }
 
-    public function pushBack(element:*):void
-    {
-        if (element == null)
-        {
-            throw new ArgumentError("DequeSet cannot contain null members");
-        }
-        var node:Node = takeNode(element);
+    public function pushBack(member:*):void
+    {
+        checkMember(member);
+        var node:Node = takeNode(member);
         Node.insertBefore(_back, node);
     }
 

        return nodeLookup[query] != null;
    }

    public function remove(element:*):Boolean
    {
        var node:Node = nodeLookup[element];
        if (node)
        {
            Node.unlink(node);
            delete nodeLookup[element];
            _length--;
            return true;
        }

        return new NodeIterator(_front, _back);
    }

    private function takeNode(member:*):Node
    {
        var node:Node = nodeLookup[member];
        if (node)
        {
            Node.unlink(node);
        }
        else
        {
            node = new Node(member);
            nodeLookup[member] = node;
            _length++;
        }
        return node;
    }

    private function getNodeAtIndex(index:int):Node
    {
        var rover:Node = null;
        if (index >= 0 && index < _length)
        {
            rover = _front.next;
            for (var i:int = 0; i < index; i++)
            {
                rover = rover.next;
            }
        }
        return rover;
    }

    private function checkMember(newMember:*):void
    {
        if (newMember == null)
        {
            throw new ArgumentError("DequeSet cannot contain null members");
        }
    }

    private function checkRelativeArguments(newMember:*, referenceMember:*):void
    {
        checkMember(newMember);
        if (nodeLookup[referenceMember] == null)
        {
            throw new ArgumentError("Reference member does not exist in this DequeSet");
        }
        if (newMember === referenceMember)
        {
            throw new ArgumentError("Member cannot be specifed relative to itself");
        }
    }
}
}
