private void load(String bookname, GameState currentGameState) {
        try {
            File book = new File(resultsFile);
            HSSFWorkbook workbook = null;
            if (!book.exists()) {
                workbook = new HSSFWorkbook();
            } else {
                workbook = new HSSFWorkbook(new FileInputStream(book));
            }

            HSSFSheet sheet = null;
            if (workbook.getSheetIndex(bookname) == -1) {
                sheet = newBook(workbook, bookname);
            } else {
                sheet = workbook.getSheet(bookname);
            }

            int rownum = 0;
            for (Row row : sheet) {
                rownum++;
                if (rownum == 1) {
                    continue;
                }
                GameState gameState = new GameState();
                int i = 0;
                gameState.map = row.getCell(i++).getStringCellValue();
                gameState.gameIsFinish = row.getCell(i++).getBooleanCellValue();
                gameState.score = (int) row.getCell(i++).getNumericCellValue();
                gameState.agentIsDied = row.getCell(i++).getBooleanCellValue();
                gameState.wamplusIsDied = row.getCell(i++).getBooleanCellValue();
                gameState.sulpmuwIsDied = row.getCell(i++).getBooleanCellValue();
                gameState.hasGold = row.getCell(i++).getBooleanCellValue();
                gameState.hasFood = row.getCell(i++).getBooleanCellValue();
                gameState.hasArrow = row.getCell(i++).getBooleanCellValue();

                beans.add(gameState);
            }

            if (currentGameState != null) {
                Row row = sheet.createRow(++rownum);
                int i = 0;
                Cell id = row.createCell(i++);
                id.setCellValue(currentGameState.map);
                Cell name = row.createCell(i++);
                name.setCellValue(currentGameState.gameIsFinish);
                Cell lat = row.createCell(i++);
                lat.setCellValue(currentGameState.score);
                Cell lon = row.createCell(i++);
                lon.setCellValue(currentGameState.agentIsDied);
                Cell adr = row.createCell(i++);
                adr.setCellValue(currentGameState.wamplusIsDied);
                Cell city = row.createCell(i++);
                city.setCellValue(currentGameState.sulpmuwIsDied);
                Cell firmc = row.createCell(i++);
                firmc.setCellValue(currentGameState.hasGold);
                Cell hasFood = row.createCell(i++);
                hasFood.setCellValue(currentGameState.hasFood);
                Cell hasArrow = row.createCell(i++);
                hasArrow.setCellValue(currentGameState.hasArrow);
                beans.add(currentGameState);
            }


            FileOutputStream out =
                    new FileOutputStream(book);
            workbook.write(out);
            out.close();
            System.out.println("Excel written successfully..");

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }