public void loadHistory(){
        BufferedReader br = null;
        InputStream is = null;
        InputStreamReader isr = null;
            
            try {
                if(historyFile.exists()){
                    // Read History log from generated file
                    System.out.println("generated file read");
                    br = new BufferedReader(new FileReader(historyFile));
                }
                else{
                    // Read History log from internal file
                    System.out.println("internal file read");
                    is = getClass().getResourceAsStream("/" + csvFileName);
                    isr = new InputStreamReader(is);
                    br = new BufferedReader(isr);
                }
                String linecontents = "";
                int lineCount = 0;
                while ((linecontents = br.readLine()) != null){ 
                    System.out.println(linecontents);
                    lineCount++;
                }

                br.close();

                // max out how many lines are read
                if(lineCount > maxrecords){
                    lineCount = maxrecords;
                }

                records = new String[lineCount];
                lineCount = 0;
                String line;

                is = getClass().getResourceAsStream("/" + csvFileName);
                isr = new InputStreamReader(is);
                br = new BufferedReader(isr);

                while ((line = br.readLine()) != null){ 
                    if((lineCount + 1)< records.length){
                        records[lineCount] = line;
                    }
                    lineCount++;
                }

            } 
            catch (FileNotFoundException e) {
                e.printStackTrace();
            } 
            catch (IOException e) {
                e.printStackTrace();
            } 
            finally {
                if (br != null) {
                    try {
                        br.close();
                    } 
                    catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }
        
           
    }