(function() {
	'use strict';
	var DoublyLinkedList = function() {
		var root, tail, count = 0;
		root = tail = null;

		function Node(element) {
			this.element = element || null;
			this.next = this.previous = null;
		}

		function add(element) {
			var node = new Node(element),
				current = null;
			if (root === null) {
				root = node;
			} else {
				current = root;
				while (current.next !== null) {
					current = current.next;
				}
				current.next = tail = node;
			}
			count++;
		}

		function remove(index) {
			var node = get(index ? index : count - 1);
			if (typeof index !== 'undefined') {
				root = removeAt(index, root);
			} else {
				root = removeAt(count - 1, root);
			}
			count--;
			return node;
		}

		function removeAt(index, node) {
			if (node === null) {
				throw new Error('removeAt(): No such element found.');
			} else if (index === 0) {
				return node.next;
			} else {
				node.next = removeAt(index - 1, node.next);
			}
			return node;
		}

		function first() {
			if (isEmpty()) {
				throw new Error('first(): List is empty.');
			}
			return root;
		}

		function get(index) {
			if (index < 0 || index > count || root === null) {
				return null;
			}
			var midPoint = count / 2,
				current, i;

			if (index > midPoint) {
				current = tail;
				for (i = count; i > index; i--) {
					current = current.next;
				}
			} else {
				current = root;
				for (i = 0; i < index; i++) {
					current = current.next;
				}
			}
			return current;
		}

		function isEmpty() {
			return count === 0;
		}

		function size() {
			return count;
		}

		return {
			add: add,
			remove: remove,
			first: first,
			get: get,
			isEmpty: isEmpty,
			size: size
		};
	};

	if (typeof define === 'function' && define.amd) {
		define(function() {
			return DoublyLinkedList;
		});
	} else if (typeof module !== 'undefined' && module.exports) {
		module.exports = DoublyLinkedList;
	} else {
		window.DoublyLinkedList = DoublyLinkedList;
	}
})();

@@ -276,28 +276,8 @@
 ent)
-,%0A%09%09%09%09current = null
 ;%0A%09%09
@@ -308,16 +308,23 @@
 %09%09root =
+ tail =
  node;%0A%09
@@ -342,118 +342,271 @@
 %09%09%09%09
-current = root;%0A%09%09%09%09while (current.next !== null) %7B%0A%09%09%09%09%09current = current.next
+tail.next = node;%0A%09%09%09%09node.previous = tail;%0A%09%09%09%09tail = node;%0A%09%09%09%7D%0A%09%09%09count++;%0A%09%09%7D%0A%0A%09%09function addFront(element) %7B%0A%09%09%09var node = new Node(element);%0A%09%09%09if (root === null) %7B%0A%09%09%09%09root = tail = node
 ;%0A
-%09
 %09%09%09%7D
-%0A%09%09%09%09current.next = tail
+ else %7B%0A%09%09%09%09node.next = root;%0A%09%09%09%09root.previous = node;%0A%09%09%09%09root
  = n
@@ -1749,16 +1749,39 @@
 d: add,%0A
+%09%09%09addFront: addFront,%0A
 %09%09%09remov
@@ -1855,16 +1855,45 @@
 ze: size
+,%0A%09%09%09iterator: new Iterator()
 %0A%09%09%7D;%0A%09%7D

add and addFront operation added