public static String reverse(String code) {
        char[] codeline = code.toCharArray();
        String reversed = "";
        for(int i = codeline.length - 1; i >= 0; i--) {
            reversed += codeline[i];
        }
        return reversed;
    }