public int allocate(String variable){
	            int i;
	            //find most distant use
	            int LRU = -1;
	            int r_index = -1;
	            for(i=0;i<4;i++){
	                  register_type r = Allregisters.get(i);
	                  if(r.recentuse>LRU){
	                        if(r.status.equals("Free")){
	                              LRU = r.recentuse;
	                              r_index = i;
	                        }
	                  }
	            }
	            if(r_index == -1){
	                  for(i=0;i<4;i++){
	                        register_type r = Allregisters.get(i);
	                        if(r.recentuse>LRU){   
	                              LRU = r.recentuse;
	                              r_index = i;
	                        }
	                  }
	            }
	            free(r_index);
	            Allregisters.get(r_index).variable = variable;
	            return r_index;
	      }