public void writeToDebugFile(String value) throws IOException {
        if(debug) {
            //append text to log
            //text = Date + time + "  ||  " + value
            FileWriter write = new FileWriter(System.getProperty("user.dir") + "/" + debugFile + ".txt", true);
            PrintWriter print_line = new PrintWriter(write);
            cal = Calendar.getInstance();
            
            print_line.printf("%n" + sdf.format(cal.getTime()) + "  ||  " + value);
            
            print_line.close();
        }
    }