public Element Findelementbyname(String name){
	      	Scope thescope = current_scope;    
	      	Element theElement = thescope.elements.get(name);
	            if(theElement==null){
	               theElement = (SymbolTable.get("GLOBAL").elements).get(name);
	            }
	            if(theElement==null){
	                  if(!stack.isEmpty()){
	                        Stack <Scope> tempstack = new Stack <Scope>();
	                        while(theElement==null){
	                      //      System.out.println("out");
	                              Scope newscope = stack.pop();
	                              tempstack.push(newscope);
	                              theElement = newscope.elements.get(name);
	                              if(stack.isEmpty()){
	                                    break;
	                              }
	                        }
	                        while(!tempstack.isEmpty()){
	                      //      System.out.println("back");
	                              Scope transfer = tempstack.pop();
	                              stack.push(transfer);
	                             
	                        }
	                        current_scope = stack.peek();
	                        //stack.push(current_scope);
	                  }
	            }
	      	return theElement;
	      }