private String changeCharacterAtPosition(int pos, String str, String rep) {
        String alteredString = str.substring(0, pos) + rep
                + str.substring(pos + 1, str.length());
        return alteredString;
    }