public int recalculateLevel() {
        int addedlevels = 0;
        int requiredExp = getExpRequirement(level);
        while (exp >= requiredExp) {
            exp -= requiredExp;
            if (exp < 0) { exp = 0; } // so that experience is never below 0
            addedlevels++;
            addLevel();
            requiredExp = getExpRequirement(level);
        }
        return addedlevels;
    }