public static Integer getLevelForCaste(int xp, String caste) throws IOException {

        int lvl = 1;
        JsonNode root = objectMapper.readValue(new File(LEVELS_FILE), JsonNode.class);
        JsonNode casteNode = root.path(caste);

        if (!casteNode.isMissingNode()) {

            for (int i = 1;; i++) {

                if (i < 13) {
                    if (xp <= casteNode.path(String.valueOf(i)).intValue()) {
                        lvl = i;
                        break;
                    }
                } else {
                    lvl = 13;
                    int tempLevel = casteNode.path(String.valueOf("12")).intValue();
                    int perLevel = casteNode.path(String.valueOf("13")).intValue();

                    while (tempLevel + perLevel < xp) {
                        tempLevel += perLevel;
                        lvl++;
                    }
                    break;
                }
            }
            return lvl;
        } else {
            System.out.println("No such class found: " + caste + ". You may check spelling!");
            return null;
        }
    }