private void loadMapFromFile(String mapFilePath) throws ParserConfigurationException, IOException, SAXException {


        DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
        DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
        Document doc = dBuilder.parse(mapFilePath);
        NodeList docNodes = doc.getChildNodes();

        Integer size = Integer.parseInt(docNodes.item(0).getAttributes().item(0).getNodeValue());
        NodeList rows = docNodes.item(0).getChildNodes();  // get the rows elements
        mapGrid = new Entity[size][size]; // the shape of the map must be square
        height = size;
        width = size;
        setColumnCount(width);
        setRowCount(height);

        int j = 0;
        int i = 0;


        for (int y = 0; y < height; y++) {
            Node row = rows.item(j);
            String[] cells = row.getTextContent().trim().split("-");
            if (row.getNodeName().equals("row")) {
                for (int x = 0; x < width; x++) {
                    if (cells[x].equals("b")) {
                        putBoxIn(x, y);
                    } else if (cells[x].equals("w")) {   // 20% of map is boxes
                        putWallIn(x, y);
                    } else if (cells[x].equals("eb")) {   // 20% of map is boxes
                        hideExitIn(x, y, boxIcon);
                    } else if (cells[x].equals("ep")) {   // 20% of map is boxes
                        hideExitIn(x, y, pathIcon);
                    } else if (cells[x].equals("p")) {   // 20% of map is boxes
                        putPathIn(x, y);
                    } else if (cells[x].equals("o")) {   // 20% of map is boxes
                    	putPowerUpIn(x, y);
                    } else {
                        // TODO investigate wether fall back to a wall or a box or should throw an error 
                    }
                }


            } else {
                y--;

            }
            j++;

        }

    }