public void add(T element) {
		// create element
		Node z = new Node();
		z.key = element;

		Node y = NULL;
		Node x = root;

		while (x != NULL) {
			y = x;
			int compare = z.key.compareTo(x.key);
			if (compare < 0) {
				x = x.left;
			} else {
				if (compare == 0 && !allowSameElementMultipleTimes) {
					return;
				}
				x = x.right;
			}
		}
		z.parent = y;
		if (y == NULL) { // case of an empty tree
			root = z;
		} else if (z.key.compareTo(y.key) < 0) {
			y.left = z;
		} else {
			y.right = z;
		}
		size++;
		// code specific to red black trees
		z.left = NULL;
		z.right = NULL;
		z.color = RED;
		insertFixup(z);
	}