private int nextElement(int above, int index){
				boolean hasNext = true;
				int n = above;
				while(hasNext){
					if(n == map.lastKey()){
						return Integer.MIN_VALUE;
					}
					n = map.higherKey(n);
					int currentN = 0;
					boolean good = true;
					int maxN = map.get(n);
					for(int i = 0; i < index; i++){
						if(current.get(i) == n){
							currentN++;
							if(currentN >= maxN){
								good = false;
								break;
							}
						}
					}
					hasNext = !good;
				}
				return n;
			}