private AVLEntry<K, V> putElem(AVLEntry<K, V> top, K key, V value) {
		if (top == null) {
			//HEADCASE
			size++;
			return new AVLEntry<K, V>(key, value);
		}
		int comp = key.compareTo(top.getKey());
		if (comp == 0) {
			top.setValue(value);
		} else if (comp > 0) {
			top.setRight(rebalance(putElem(top.getRight(), key, value)));
		} else {
			//comp < 0
			top.setLeft(rebalance(putElem(top.getLeft(), key, value)));
		}
		return rebalance(top);
	}