public int order(int x){		
		Object node= this.root;
		int ans= 0;
		while (!(node instanceof Leaf)){	//while we havent found the key's leaf
			Junction junctionNode= (Junction)node;
			Vector<Link> elements= junctionNode.getElements();
			Vector<Object> pointers= junctionNode.getPointers();
			int i;	//i will hold the location of the key
			for (i= 0; ((i != -1) && (i < elements.size())); i++){	//sums the keys we skipped over
				if (x > elements.elementAt(i).getElement()){
					if (pointers.elementAt(i) instanceof Leaf)
						ans+= ((Leaf)pointers.elementAt(i)).getSize();
					else
						ans+= ((Junction)pointers.elementAt(i)).numOfElements();
				}
				else {
					node= pointers.elementAt(i);
					i= -2;
				}
			}
			if (i != -1){
				node= pointers.lastElement();
			}
		}
		Leaf leafNode= (Leaf)node;	//this is the leaf where the key is located
		Vector<Link> data= leafNode.getData();
		for (int i=0; i < leafNode.getSize(); i++){	//adds the number of keys that are before 'x' in his leaf
			if (x >= data.elementAt(i).getElement()){
				ans++;
			}
			else
				i= leafNode.getSize();
		}
		return ans;
	}//order(int)